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

wa 2!!!
Posted by Vadim 30 Oct 2011 00:35
Do you known test?I got wa 2,but I think that my program is right)
Re: wa 2!!!
Posted by Vadim 30 Oct 2011 00:40
It's my code:
var
F:array[0..1000000] of longint;
I,j,mi,n:longint;
Begin
Read(n);
F[0]:=0;
F[1]:=1;
F[2]:=2;
For i:=3 to n do
Begin
Mi:=100000;
For j:=1 to trunc(sqrt(i)) do
If mi>f[i-j*j] then mi:=f[i-j*j];
F[i]:=mi+1;
End;
Writeln(f[i]);
End.
Re: wa 2!!!
Posted by Noob 30 Oct 2011 01:30
Writeln(f[i]); = undefined behaviour

first of all, try f[n], not f[i]
Re: wa 2!!!
Posted by Vadim 30 Oct 2011 13:44
You are a superman!!!!!!!!!!!!Thanks)