Search found 5 matches

by Young20
Sat Jul 07, 2007 4:23 pm
Forum: Volume 105 (10500-10599)
Topic: 10505 - Montesco vs Capuleto
Replies: 73
Views: 47765

Hmm..
How about this input..
It makes me crazy.


1

100
2 23
0
0
3 3 8 11
3 8 11 13
1 11
1 13
2 4 5
2 18 13
3 20 18 21
3 4 5 6
1 21
0
0
0
0
1 21
2 9 10
1 21
0
4 12 17 19 25
0
0
2 25 27
4 21 22 23 24
0
2 24 26
0
3 30 37 38
3 26 28 29
0
0
0
0
0
0
1 29
2 29 31
1 40
3 31 39 51
0
0
0
0
0
0
0
0
0
0
0
0 ...
by Young20
Sat Jul 07, 2007 1:57 pm
Forum: Volume 105 (10500-10599)
Topic: 10513 - Bangladesh Sequences
Replies: 15
Views: 10115

I try to solve this like DFS.
When n is up to 13, it works pretty well. But n goes up 14 and 15, it get TLE.
I have to optimize my code in order to avoid TLE.

Could you give me some hint how I can prune unvisited node under this non bangladesh sequence?

Thanks
by Young20
Sat Jul 07, 2007 2:41 am
Forum: Volume 105 (10500-10599)
Topic: 10505 - Montesco vs Capuleto
Replies: 73
Views: 47765

Hello

first of all, it has type error. These two line should be changed like that

for (a = x, r1 = 0; bipartite[a][0] != -1; r1 +=bipartite[a][1], a = bipartite[a][0]);
for (b = y, r2 = 0; bipartite[b][0] != -1; r2 +=bipartite[b][1], b = bipartite[b][0]);

But still got WA.. even though I ...
by Young20
Fri Jul 06, 2007 8:41 pm
Forum: Volume 105 (10500-10599)
Topic: 10505 - Montesco vs Capuleto
Replies: 73
Views: 47765

Hmm..
I almost exhausted.. I have no idea why I got WA..
Could somebody give me a little hint?

My code below and my algorithm like that.
1. build bipartite graph(like tree structure)
2. if there need to combine each other trees, make one tree.
3. print out maximum number of invitation.


#include ...
by Young20
Fri Jul 06, 2007 6:52 pm
Forum: Volume 105 (10500-10599)
Topic: 10505 - Montesco vs Capuleto
Replies: 73
Views: 47765

I'm trying to solve this problem.
I passed all above test case. HOWEVER I still got Wrong Answer..
I really don't know why.. so I wonder there are some tricky input test case..
Anyway, would someone give me correct output regarding input below?
Input..

2

10
3 2 3 4
1 6
0
1 5
0
1 9
3 8 9 10
0
1 3 ...

Go to advanced search