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 1295. Crazy Notions

Show all messages Hide all messages

Why WA on test 8? ss 25 Mar 2005 20:53
My code:
---------------------------------
|const a:array[1..20]of integer = (2,1,2,0,1,1,2,0,1,1,2,0,1,1,2,0,1,1,2,0);
|
|var n:integer;
|
|begin
|  readln(n);
|
|  if n=1 then writeln(1) else
|  if n=2 then writeln(1) else
|  if n=3 then writeln(2) else
|  if n=4 then writeln(0)
|  else begin
|   n:=(n mod 20)-4 ;
|   writeln(a[n]);
|  end;
|end.
Re: Why WA on test 8? morbidel 25 Mar 2005 23:25
I used my AC program (who is actually brute force, keeping the last 3 digits) and for 101 yours outputs 0 and mine 1...
Re: Why WA on test 8? ss 26 Mar 2005 22:57
I found my stupid bag.