Search found 3 matches

by NeeDay
Mon Mar 23, 2009 6:38 pm
Forum: Volume 1 (100-199)
Topic: 122 - Trees on the level
Replies: 103
Views: 10987

I got WA. Though my program is not good, i think it is right

I just can't make it right. Can anybody supply a better way to store the tree? Besides, i got WA in 0.000, so there must be a case i did consider.... it can make the right answer to the cases in the forum, and also this one: http://fdemesmay.dyndns.org/cs/acm/v1/122.in Here is my code, help #include...
by NeeDay
Tue Feb 17, 2009 7:03 am
Forum: Volume 115 (11500-11599)
Topic: 11572 - Unique Snowflakes
Replies: 36
Views: 12970

Re: 11572 - Unique Snowflakes

bool * a = new bool[1000000001]; 1) You are declaring a huge memory locally. 2) 1000000000 byte = 954 MB (almost), the memory limit is 32 MB. You can use a map instead of the array. Now it takes O(1) to access, but in a map it will take O(log(n)), but still its feasible. Hope these help. Thanks. I ...
by NeeDay
Mon Feb 16, 2009 11:05 am
Forum: Volume 115 (11500-11599)
Topic: 11572 - Unique Snowflakes
Replies: 36
Views: 12970

Re: 11572 - Unique Snowflakes

HEY! This is my wrong code and I just can not find what is the matter. Or... I am not clear about the problem... Suggestions and some test cases are welcome. Thanks. #include <iostream> using namespace std; int main() { int t; cin >> t; bool * a = new bool[1000000001]; long n; for(int tt = 0; tt < t...

Go to advanced search