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 1002. Phone Numbers

WA on #1
Posted by cyc 16 Jul 2009 14:29
I have a std program and i almostly have the same way of it, but i got WA.
what's the secret of test#1?
my way is DP.
    for i:=2 to n+1 do
        for j:=1 to i-1 do
            if (map[j,i]>0)and(f[j]+1<f[i]) then begin
                f[i]:=f[j]+1;
                fro[i]:=j;
            end;

my way is right, but i made a mistake in output.i have got AC.

Edited by author 16.07.2009 14:47

Edited by author 16.07.2009 14:47

Edited by author 16.07.2009 14:47