首页 > 代码库 > AC日记——T-Shirt Hunt codeforces 807b
AC日记——T-Shirt Hunt codeforces 807b
T-Shirt Hunt
思路:
水题;
代码:
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;int p,x,y,ai[27],ans;bool check(int xx){ if(xx<y) return false; int i=(xx/50)%475; for(int j=1;j<=25;j++) { i=(i*96+42)%475; if(p==26+i) return true; } return false;}int main(){ scanf("%d%d%d",&p,&x,&y); int pos=x; while(pos>=y) { if(check(pos)) { printf("0"); return 0; } pos-=50; } while(x<y) x+=100,ans++; while(1) { if(check(x)||check(x-50)) { printf("%d",ans); return 0; } x+=100,ans++; } return 0;}
AC日记——T-Shirt Hunt codeforces 807b
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。