Search found 100 matches

by xenon
Sun Jun 09, 2002 5:49 pm
Forum: Volume 1 (100-199)
Topic: 157 - Route Finding
Replies: 17
Views: 2661

ok

hi yourself! 't was just a thought. Sure, there is only one shortest route in the input I made up, the route via 'Ag' is longer (9) then via 'Ba' (8). I just didn't see your routefinder rule out traveling from 'Bb' (mtime=8) to 'Ag' (mtime=6), since conn['Bb']['Ag']==1 (it's a station), while the ac...
by xenon
Sun Jun 09, 2002 4:48 pm
Forum: Volume 1 (100-199)
Topic: 157 - Route Finding
Replies: 17
Views: 2661

to caesum

I have no C-compiler at hand, so I did a little 'mind-debugging'. Consider the input: 3 A:a=Cabcdefg=Bb B:a=Cbb=Ag C:a=Aab=Ca BbAa # The correct answer is: 8:Bba=Cba=Aa but I think your program produces: 8:Bb=Agfedcba Your floodfill fills mtime['Ag'] with 6 and mtime['Ba'] with 7. Both values are co...
by xenon
Sun Jun 09, 2002 1:31 pm
Forum: Pascal
Topic: formatting integers
Replies: 5
Views: 3296

no problem, mate. thx for looking into it.
I encountered more PEs with other problems. I could report them, if you like, but they could as well be caused by programming errors made by myself.
by xenon
Sun Jun 09, 2002 9:14 am
Forum: Pascal
Topic: formatting integers
Replies: 5
Views: 3296

nothing seems to work...

Thanx for your reply. But whatever I try (:0, or no formatting at all) I still get PE. And there is no extra blank line after the last case. So for the sake of argument, I'll post my solution for #231: [pascal]program p231(input,output); {$IFNDEF ONLINE_JUDGE} type integer=system.longint; {$ENDIF} v...
by xenon
Sat Jun 08, 2002 2:57 pm
Forum: Volume 2 (200-299)
Topic: 202 - Repeating Decimals
Replies: 82
Views: 10920

200 is still too small then... there's no penalty for using large arrays, so why don't try something like 10000?
by xenon
Sat Jun 08, 2002 2:09 pm
Forum: Volume 2 (200-299)
Topic: 202 - Repeating Decimals
Replies: 82
Views: 10920

your arrays are too small. the program tries to access elements outside the range [0..100].
by xenon
Sat Jun 08, 2002 11:01 am
Forum: Other words
Topic: A Question On The Honour Code
Replies: 5
Views: 2551

You are right re #138. Now I looked at the problem again, I see the 'zero time' solution, so my statement about the 700 solvers was too hasty, altough I still suspect that a great deal of them (including myself) uses 10 printf statements. This is, however, more a matter of 'personal satisfaction' th...
by xenon
Fri Jun 07, 2002 5:48 pm
Forum: Other words
Topic: A Question On The Honour Code
Replies: 5
Views: 2551

everything is permitted in love and war...
look at the ranking for #138: the first 700 or so have CPU times of 0ms, so they just outputted the 10 asked values (like i did, btw).
the only thing that counts is a solution that is approved by the judge.
and hey, you saved it some clock cycles!
by xenon
Fri May 24, 2002 11:39 am
Forum: Volume 101 (10100-10199)
Topic: 10110 - Light, more light
Replies: 76
Views: 26126

use type cardinal in pascal

type integer is signed 32 bits. type cardinal is unsigned 32 bits (could be more, I don't know). this code works: [pascal]var n,r:cardinal; begin repeat readln(n); if (n=0) then break; r:=trunc(sqrt(n)); if (r*r=n) then writeln('yes') else writeln('no'); until false; end. [/pascal] so there's no rou...
by xenon
Fri May 24, 2002 10:46 am
Forum: Pascal
Topic: formatting integers
Replies: 5
Views: 3296

formatting integers

Can anybody tell me how to properly format integers? I get a lot of PEs and sometimes WAs because my code obviously does something wrong. I don't use gpp on linux, as advised, but always put the ':1' formatter after a number. In problem 231 I get PE when outputting with: [pascal] writeln('Test #',te...

Go to advanced search