|
|
back to boardCommon BoardPlease, HELP! I can't understand why I have got WA (1044)! My program solves all my tests, but it always gets WA from Online Judge, WHY? Here is my program: program tim1044; var main,nd2,n,i,sum,q: integer; otv: longint; a: array [0..36] of longint; begin readln(n); nd2:=n div 2; repeat sum:=0; q:=main; for i:=1 to nd2 do begin sum:=sum+(q mod 10); q:=q div 10; end; if q>0 then break; a[sum]:=a[sum]+1; main:=main+1; until false; for i:=0 to 9*nd2 do otv:=otv+a[i]*a[i]; if n mod 2=1 then otv:=otv*10; writeln(otv); end. Thank you! |
|
|