Search found 62 matches

by arc16
Mon Sep 30, 2002 5:53 pm
Forum: Pascal
Topic: input problem
Replies: 12
Views: 12705

there are two ways: the first, which i used, is: readln(input,count); while (count>0) do begin readln(input); {read blank space} .... {read input like usual problem} count:=count-1; end. or you can also use this: readln(input,temp); while not eof(input) do begin readln(input); {read blank space} ......
by arc16
Sun Sep 29, 2002 2:50 pm
Forum: Volume 6 (600-699)
Topic: 603 - Parking Lot
Replies: 11
Views: 5100

i can't find anything wrong with your program, it produce the same output with my AC program for any test case i've tried. Maybe the problem is from reading the input? And will there be more than 1 car waiting for one car park? If yes, my programme can't solve the problem. no, there won't be such ca...
by arc16
Sun Sep 29, 2002 2:25 pm
Forum: Pascal
Topic: input problem
Replies: 12
Views: 12705

fpnc wrote:... but you'll get a perfect "Restricted function" when doing that in our system, as file access is forbiden.
i used it on the local contest, i've never used it on the program i submit to OJ :D
by arc16
Sun Sep 29, 2002 1:42 pm
Forum: Pascal
Topic: input problem
Replies: 12
Views: 12705

Just use input as the file for the keyboard, and output as the file for the console, and do not try to open or close them. btw, just want to add that we still can open/close that special input/output file and direct them to standard input/output by using '' as parameter. for example: [pascal] assig...
by arc16
Sat Sep 28, 2002 1:58 pm
Forum: Volume 103 (10300-10399)
Topic: 10356 - Rough Roads
Replies: 29
Views: 15406

hi,
i think it's not the problem with FPC, it's just that the input data is badly formatted. Instead of readln, i use read, and i get AC using Pascal :wink:

so the input could be like this:

Code: Select all

       3             3
0          1 
10  0       2     10
     1 
2 
10
by arc16
Fri Sep 27, 2002 1:17 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 79314

Why do you have to sort it? You only have to check the _absolute difference_ between the current number and its pred. If it match the required condition then it's a jolly, else it's not a jolly jumper. Be careful, i've got WA for several times too because i misunderstand the problem. I hope you don'...
by arc16
Fri Sep 27, 2002 1:17 am
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 43925

hmmm, sometimes it's about how to READ the input, not to write it. You know, the input could be ugly for some problem, lot of blank space, empty line, etc etc etc. :cry:
by arc16
Fri Sep 27, 2002 1:11 am
Forum: Volume 8 (800-899)
Topic: 808 - Bee Breeding
Replies: 19
Views: 10671

i guess no cell number > 10000, although 10000 will occur.
maybe you can try this:

Code: Select all

1 10000
10000 5
9999 10000
10000 10000
answer is:

Code: Select all

58
58
1
0
good luck :lol:
by arc16
Thu Sep 26, 2002 5:00 pm
Forum: Volume 102 (10200-10299)
Topic: 10278 - Fire Station
Replies: 59
Views: 20857

thank you very much Even, and all who help me :lol:
i'm still not getting AC, but now i got TLE. I think it's much better than WA :P just need a little tweak here and there...
once again, thank you thank you thank you :D :D :D
by arc16
Thu Sep 26, 2002 11:42 am
Forum: Volume 102 (10200-10299)
Topic: 10278 - Fire Station
Replies: 59
Views: 20857

hi even, first, thank you so much for your help according to your hint, i change my algo to the following, please tell me where i go wrong... min = inf, nmin = -1 for all intersect i do for all intersect j do if no firestation in intersection j and distance[i,j]<min then nmin = j min = distance[i,j]...
by arc16
Thu Sep 26, 2002 2:14 am
Forum: Volume 102 (10200-10299)
Topic: 10278 - Fire Station
Replies: 59
Views: 20857

so i have to find the intersection which have the most/average shortest path to another intersection? from the matrix, can i just sum the total distance of every intersection to other intersection and find the minimum? for the previous test case, my floydd matrix is: 0 10 20 20 10 0 10 10 20 10 0 20...
by arc16
Wed Sep 25, 2002 7:01 pm
Forum: Volume 103 (10300-10399)
Topic: 10365 - Blocks
Replies: 7
Views: 4260

i think you misunderstood the problem :) first, 5 is the number of test case... 2nd, for 10 blocks, the possible arrangement is 1*1*10 or 1*2*5. that goes to 26 blocks, which have possible arrangement of 1*1*26 or 1*2*13. For 27 blocks, the possible arrangement is 1*1*27, 1*3*9, and 3*3*3. For each ...
by arc16
Wed Sep 25, 2002 6:15 pm
Forum: Volume 102 (10200-10299)
Topic: 10278 - Fire Station
Replies: 59
Views: 20857

okay, now could you tell me why the 3rd case output from Even is 2? i still don't understand it :(
by arc16
Wed Sep 25, 2002 10:25 am
Forum: Volume 102 (10200-10299)
Topic: 10278 - Fire Station
Replies: 59
Views: 20857

output is

Code: Select all

1

1

1

2
is it correct?
by arc16
Wed Sep 25, 2002 1:46 am
Forum: Volume 102 (10200-10299)
Topic: 10278 - Fire Station
Replies: 59
Views: 20857

hmmm, same as mine... i still got WA too.. i have test the judge input using halt() (pascal), and it looks like there's an input when there's already one or more firestation in every intersection. So i think i have to find how to solve that case, but how :-? some of my though: 1. put the firestation...

Go to advanced search