## Search found 19 matches

Sun Oct 20, 2002 9:07 am
Forum: Volume 102 (10200-10299)
Replies: 41
Views: 19870

### 10261

I got WA many time. I checked my program using the data I found in http://plg.uwaterloo.ca/~acm00/, and it was right. Who can tell my program's bug? Thanks. [pascal] const maxn = 10010; var f,g : array[0 .. maxn] of boolean; pre : array[0 .. maxn] of integer; w : array[1 .. 210] of integer; sol : ar...
Tue Sep 24, 2002 1:53 pm
Forum: Volume 103 (10300-10399)
Topic: 10358 - Matrix
Replies: 9
Views: 3446
Emm~, I changed my algorithm. First, I use three loops to find the best position for both "I" and agents. [pascal] noe := true; for i := 1 to 32 do if dist[m, i] < 100 then begin now := true; for j := 1 to 32 do if (i <> j) and (dist[a1, j] < 100) and (dist[a1, i] > dist[m, i]) then for k := 1 to 32...
Fri Sep 20, 2002 5:19 pm
Forum: Volume 103 (10300-10399)
Topic: 10358 - Matrix
Replies: 9
Views: 3446

### 10358 - Matrix

Can I solve it like this :
First calc both "my" and agents' min-dist to all the girds from own position, then compare the dist. If "mine" is shorter than two agents', "I" can escape. Otherwise, "I" may be eliminated or trapped in the Matrix.

I think it may be right. But it got WA.
Wed Aug 07, 2002 4:43 pm
Forum: Volume 102 (10200-10299)
Replies: 41
Views: 19870
I also got WA. So i want to know whether i should keep abs(portlen - starboardlen) is minimal. Can anyone who got AC tell me that?
Sun Aug 04, 2002 3:34 pm
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 32908
Thanks! I got AC now.
Sun Aug 04, 2002 11:53 am
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 32908

### 10340

I think my program is no problem. But it got runtime error. [pascal] const name1 = ''; name2 = ''; maxn = 10000; var s,t : array[1 .. maxn] of char; ls,lt : integer; procedure init; var w : char; begin ls := 0; lt := 0; fillchar(s, sizeof(s), 0); fillchar(t, sizeof(t), 0); read(w); while w <> ' ' do...
Wed Jul 31, 2002 12:11 pm
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20733
I find my bugs.~~~~~

[pascal]
for i := l downto 2 do
if (cp > 0) and (w > 0) then begin
inc(cp[w], cp);
inc(cp[i div w], cp);
cp := 0;
end;
[/pascal]

cp > 0 should be cp <> 0
Wed Jul 31, 2002 5:27 am
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20733
So far as I know, Longint is a 64bit integer, it can reach 2^63. Right?
Tue Jul 30, 2002 4:21 pm
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20733

### 10338 WA

I think my algorith is right. But it got WA. Maybe i have some input mistakes. [pascal] const name1 = ''; name2 = ''; maxn = 22; var cp,w : array[1 .. maxn] of integer; ck : array[1 .. maxn] of boolean; n,l,p : integer; st : string[maxn]; procedure init; begin readln(st); l := length(st); end; proce...
Mon Jul 29, 2002 3:49 pm
Forum: Volume 103 (10300-10399)
Topic: 10308 - Roads in the North
Replies: 30
Views: 9941

### 10308

It says "The villages are numbered from 1."
Does it mean the villages are numberd 1, 2, 3, 4, ..., n, when the number of village is n.
Mon Jul 29, 2002 2:21 pm
Forum: Volume 102 (10200-10299)
Topic: 10288 - Coupons
Replies: 8
Views: 3597
DP is OK.
Consider that F is the result when n = i, F[i + 1] = F * (i + 1) / i + 1.
Sat Jul 27, 2002 10:01 am
Forum: Pascal
Topic: Problem about RedhatLinux 7.1 + fpc1.0.6 + rhide1.4.9?
Replies: 0
Views: 1852

### Problem about RedhatLinux 7.1 + fpc1.0.6 + rhide1.4.9?

When i compile my program, everything is ok. But when i make the executable file, it didn't work. It just generated a file named ppas.sh. So I can't continue. Why?
Fri Jul 26, 2002 9:49 am
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 23612
It's very obvious that i forgot i had moved it. I'm sorry! Thanks a lot!
Thu Jul 25, 2002 5:39 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 23612
Oh, sorry. When I submited it, I deleted it. So it's not the problem.
Thu Jul 25, 2002 3:09 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 23612
Well, thank you for your help. But I have already used what you said to improve my programme's speed. It got TLE. I am interested why your programmes is so fast. I post my program. I think you can tell me what's the different between yours and mine. [pascal] const name1 = ''; name2 = ''; maxn = 1000...