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 1073. Square Country

why i have WA#1
Posted by alexdeg 11 Mar 2013 20:30
var
 fi,fv:text;
 chi,kolc: longint;
procedure round_sqrt(a:longint; var kol:longint);
var
   b:longint;
begin
     b:=trunc(sqrt(a));
     b:=b*b;
     a:= a-b;
     if a> 0 then begin
        kol:=kol+1;
        round_sqrt(a,kol);
     end
     else kol:=kol+1;
end;
begin
assign(fi,'input.txt');
reset(fi);
assign(fv,'output.txt');
rewrite(fv);
{============}
read(fi,chi);
kolc:=0;
if chi>0 then
round_sqrt(chi,kolc);
write(fv,kolc);
{============}
close(fi);
close(fv);
end.
Re: why i have WA#1
Posted by Kvark_161 30 Mar 2013 13:16
Don't use files. Only standart streams.