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 1379. Cups Transportation

WA#25 what's the problem?
Posted by ¥@§@® Δδδ@$☺√ 10 Dec 2007 14:07
Here's the main part of my code:

for i:=0 to n-1 do
  begin
   cpt[i]:=1441;
   for j:=0 to n-1 do t[i,j]:=1441;
  end;
 for i:=0 to m-1 do
  begin
   read(x,y);
   dec(x); dec(y);
   readln(t[x,y],w[x,y]);
   dec(w[x,y],3000000);
   w[x,y]:=w[x,y] div 100;
   w[y,x]:=w[x,y];
   t[y,x]:=t[x,y];
  end;
 cup[0]:=10000000; cpt[0]:=0;
 for i:=0 to n-1 do
  for j:=0 to n-1 do
   begin
    if i=j then continue;
    m:=min(cup[j],w[i,j]);
    r:=cpt[j]+t[i,j];
    if (cup[i]<m)and(r<1441) then
     begin
      cup[i]:=m;
      cpt[i]:=r;
     end;
   end;
Re: WA#25 what's the problem?
Posted by ¥@§@® Δδδ@$☺√ 12 Dec 2007 21:27
Please, who can give me tricky tests where my code fails?
I can't find my mistake. More over, my algo is true as well.
Re: WA#25 what's the problem?
I have wa #25 too:(
Re: WA#25 what's the problem?
Posted by svr 20 Dec 2007 21:51
Use random tests!
Very helpfull.
After 450 I couln't without this method.
Re: WA#25 what's the problem?
Thanks, but how I get answers for this tests?
Re: WA#25 what's the problem?
Posted by svr 20 Dec 2007 22:11
On some random tests answer of wrong program
is obviously wrong.
For example you may use broote forse method
as alternative on small dimensions.

Edited by author 20.12.2007 22:13
Re: WA#25 what's the problem?
I have AC:-) it was is stupid bug in dijkstra...
But that is 'Brut Force Method'? Can you send me letter about this method to mail on russian, because i don't know english good... x2m@mail.ru
Re: WA#25 what's the problem?
Posted by svr 20 Dec 2007 22:28
Broote forse method is full search with gatanteed right
answer.
Re: WA#25 what's the problem?
Posted by Yashar Abbasov 21 Dec 2007 02:30
Can you tell me what did you change in your program? i can't still find my mistake. can you send me your code to my e-mail?(yashar25.92@mail.ru)
Thanks