ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1191. Catch the thief!

What should I do. Can you give me some test.
Posted by Fender_moo 2 May 2006 20:15
I've got WA on case 10.
plz help me.
#include<stdio.h>
int main(){
....int n,k,i,dis;
....scanf("%d%d",&dis,&n);
....for(i = 0;i < n;i++){
........scanf("%d",&k);
........if(dis != k) dis -= k;
........if(dis < 0){printf("YES"); return 0;}
........if(dis % k != 0) dis += k - dis%k;
....}
....printf("NO");
....return 0;
}

Edited by author 02.05.2006 23:21
Re: What should I do. Can you give me some test.
Posted by Burunduk1 4 May 2006 21:22
Change (dis != k) to (dis % k != 0) and you'll get AC.
Good luck ;)
Re: What should I do. Can you give me some test.
Posted by Fender_moo 6 May 2006 00:14
Thank you very much!!
Now I got AC.