|
|
back to boardCommon BoardI got WA,anyone help me!!!---URAL 1120 I tested my program with some datas made by me, all are correct. but I got WA when I submited my program. who can give me some test data or tell me why I got WA? specially thanks! here are my code: {$N+} Const zero=1e-8; Var n,t,k:longint; p:extended; Procedure print; var t:longint; begin t:=trunc(p-k div 2); if not odd(k) then inc(t); writeln(t,' ',k); halt; end; Begin readln(n); if n=1 then begin writeln('1 1'); halt; end; t:=trunc(sqrt(2)*sqrt(n)); for k:=t downto 1 do begin p:=n/k; if p-k/2-0.5<=zero then continue; if (odd(k)) and (frac(p)<=zero) then print; if (not odd(k)) and (abs(frac(p)-0.5)<=zero)then print; end; End. |
|
|