Search found 12 matches

by Tomson
Tue Dec 23, 2003 7:27 am
Forum: Volume 105 (10500-10599)
Topic: 10587 - Mayor's posters
Replies: 16
Views: 7731

Thank you very much! :) I almost understand your meaning.
And finally, I solved it using a heap, it seems that 's faster than a array. my program solved it during 00.5 s.

Thank you anyway!
by Tomson
Mon Dec 22, 2003 6:20 pm
Forum: Volume 105 (10500-10599)
Topic: 10587 - Mayor's posters
Replies: 16
Views: 7731

There is probably be a slicker way to do it, but basically, I place a y for each poster (distinct), so I'll know what's "on top", sort as follows, and then keep an array of what's "in", and a variable for being on top, and whenever that changes, I increment.. Oh, I still cannot understand your mean...
by Tomson
Sun Dec 21, 2003 5:57 pm
Forum: Volume 105 (10500-10599)
Topic: 10587 - Mayor's posters
Replies: 16
Views: 7731

10587 - Mayor's posters

How to solve it ? I always got TLE.
Could anybody give me some hints?
Thanks very much!
by Tomson
Sun Dec 21, 2003 5:54 pm
Forum: Volume 105 (10500-10599)
Topic: 10585 - Center of symmetry
Replies: 11
Views: 3249

hint: you could sort all the points first of all.
by Tomson
Thu Nov 27, 2003 1:44 pm
Forum: Volume 105 (10500-10599)
Topic: 10510 - Cactus
Replies: 31
Views: 22686

Oh...., I also got WA. My algo. is very simple: From an arbitrary vertice, use DFS to reach the next vertice, if the current reached vertice has been visited, that means a cycle has been found, then set all of the edges on the cycle to be used, and return, if one of the edges has been set to be used...
by Tomson
Thu May 01, 2003 3:06 pm
Forum: Volume 104 (10400-10499)
Topic: 10484 - Divisibility of Factors
Replies: 39
Views: 18652

Oh, Yes , I neglected this point, Now I got AC
Thank you very much :lol:
by Tomson
Thu May 01, 2003 1:21 pm
Forum: Volume 104 (10400-10499)
Topic: 10448 - Unique World
Replies: 8
Views: 3762

for this test case:

Code: Select all

1
2 1
1 2 1
1
1 1 2
should output "No" or "Yes" ??
by Tomson
Thu May 01, 2003 1:10 pm
Forum: Volume 104 (10400-10499)
Topic: 10484 - Divisibility of Factors
Replies: 39
Views: 18652

Oh, My luck is so bad. Yes, I've considered the case that d = -1, but still got WA. here is my code. I' m so puzzle. can you give me some help? [cpp] #include <iostream.h> #include <memory.h> int primes[26] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 8...
by Tomson
Thu May 01, 2003 10:35 am
Forum: Volume 104 (10400-10499)
Topic: 10448 - Unique World
Replies: 8
Views: 3762

who can give me some test cases about this problem.
I always got WA, but I don't know why.
:cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:
by Tomson
Thu May 01, 2003 9:07 am
Forum: Volume 104 (10400-10499)
Topic: 10484 - Divisibility of Factors
Replies: 39
Views: 18652

turuthok

I've changed my code as
[cpp]
if ( n==0 ) {
if ( d==1 )
cout << 1 << endl;
else
cout << 0 << endl;
}
[/cpp]
but I still got WA.
I don't know why, can you help me?
by Tomson
Thu May 01, 2003 8:05 am
Forum: Volume 104 (10400-10499)
Topic: 10484 - Divisibility of Factors
Replies: 39
Views: 18652

your mean is because 0! equals 1, if n==0, 1 should be outputed but 0, didn't it? I modified this bug, but I still got WA. :cry: :cry: :cry: Why???? [cpp] #include <iostream.h> #include <memory.h> int primes[26] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, ...
by Tomson
Wed Apr 30, 2003 8:18 pm
Forum: Volume 104 (10400-10499)
Topic: 10484 - Divisibility of Factors
Replies: 39
Views: 18652

I always got WA, I don't know why?

:cry: I always got WA, can somebody help me or give me some test cases? Thanks very much! :cry: :cry: :cry: [cpp] #include <iostream.h> #include <memory.h> int primes[26] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 111 }; int cnt[30]; void main...

Go to advanced search