Search found 7 matches

by koala
Fri Apr 16, 2004 8:37 am
Forum: Volume 106 (10600-10699)
Topic: 10634 - Say NO to Memorization
Replies: 18
Views: 10176

10634 - Say NO to Memorization

The answer is just the value of C(n+v-1,v-1)+C(n+v-3,v-1)+C(n+v-5,v-1)+...+C(v or v-1,v-1).
I caculated it directly and my program got ACed in 1.9x(sec). :( rather slow
But many people's programs used much less time. I wonder how they made it.
by koala
Tue Apr 06, 2004 12:58 pm
Forum: Volume 102 (10200-10299)
Topic: 10246 - Asterix and Obelix
Replies: 29
Views: 14650

something wrong with the description

It should be "Print a blank line after each case."
by koala
Fri Apr 02, 2004 9:35 am
Forum: Volume 105 (10500-10599)
Topic: 10567 - Helping Fill Bates
Replies: 15
Views: 10830

To Whinii F.

To Whinii F. :

Yes, there is a more simple method.

Let Pos[ch(Char),i(Longint)] be the position of i-th ch in S. Because Pos[ch,i]<Pos[ch,i+1], Binary Search can be used here, too.

Let Length(ch) be the length of array Pos[ch]. Obviously, Length('A')+Length('B')+...+Length('Z')+Length('a ...
by koala
Thu Apr 01, 2004 2:56 pm
Forum: Volume 105 (10500-10599)
Topic: 10568 - n Group k
Replies: 9
Views: 3583

agree

Yes, use recursion. :D
by koala
Mon Mar 29, 2004 2:31 pm
Forum: Volume 105 (10500-10599)
Topic: 10574 - Counting Rectangles
Replies: 23
Views: 11268

I use Marian's method, but got WA. I don't know why

I dunno why i've got wa. :(
If the number of different x is smaller than the number of different y, I will turn the plane. Maybe it can make the program more efficient.
[pascal]
Program Counting_Rectangles;

Const
Maxn=5000;

Type
TPoint=Record
x,y:Longint;
End;
TLink=^TNode;
TNode=Record ...
by koala
Sun Mar 28, 2004 1:36 pm
Forum: Volume 103 (10300-10399)
Topic: 10382 - Watering Grass
Replies: 29
Views: 17101

10382 - Watering Grass

My algorithm is:
1. Since covering the entire strip and covering the upper bound are equivalent, each sprinkler can be represented by an interval.
2. Use GREEDY algorithm to solve it.
Is it correct? I think so, but why did I got WA.
[pascal]
Program Watering_Grass;

Const
Maxn=10000;
Zero=1e-3; {I ...
by koala
Sun Mar 28, 2004 9:54 am
Forum: Volume 103 (10300-10399)
Topic: 10380 - Shogi Tournament
Replies: 10
Views: 6090

10380 Shogi Tournament-------------Why WA?

I got WA at about 10.x sec.
Can anyone tell me why or give me some testcases?
[pascal]
Program Shogi_Tournament;

Const
Maxn=50;
Maxmatch=Maxn*Maxn;

Type
Link=^Node;
Node=Record
data,c,f:Longint;
next,g:Link;
End;

Var
a:Array [1..Maxmatch+Maxn+2] of Link;
res:Array [1..Maxn,1..Maxn,1..2 ...

Go to advanced search