This hint is really helpful and gits fast gives the whole solution.
I write my solution after reading this hint, got AC, but it takes 1.340s which is much longer than most of others. So i think it should be solved in a o(n^3) algo. Someone has said it can be done with DP,but i can' t catch that.
Search found 35 matches
- Mon Jun 26, 2006 7:29 pm
- Forum: Volume 1 (100-199)
- Topic: 104 - Arbitrage
- Replies: 223
- Views: 18045
- Sat Jun 10, 2006 12:04 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11047 - The Scrooge Co Problem
- Replies: 31
- Views: 14706
I used dijkstra algo, and it passes all available input, but I still got WA. I really don't know what may be wrong, hope someone can help,please! I post my code here, after I find the mistake I will cut it. Thanks in advance. #include <stdio.h> #include <string.h> int main(void) { int t,n,m; int i,j...
- Tue Jun 06, 2006 9:07 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11045 - My T-shirt suits me
- Replies: 18
- Views: 10752
- Tue Jun 06, 2006 8:30 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11047 - The Scrooge Co Problem
- Replies: 31
- Views: 14706
- Tue Jun 06, 2006 5:19 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11047 - The Scrooge Co Problem
- Replies: 31
- Views: 14706
- Wed May 31, 2006 9:30 am
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 18832
- Tue May 30, 2006 2:25 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 18832
i did %m everytime So did I! To make sure that each element saved in my table is smaller than MAXINT and so that product of two 4B integers cannot exceed a 8B integer and this product %m is once again smaller MAXINT and so on. my dp algo is following: f[n][k] is the fitness of k numbers from a[1..n...
- Tue May 30, 2006 9:42 am
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 18832
Re: overflow ??
Try to use 64bit integers like long long int in C. I have tried with long long int, but got still WA, and my code passes the input above, maybe I miss some tricky cases(if any?). Can someone give me the output for following input? 2 2147483647 2147483646 2147483646 3 2147483647 2147483646 214748364...
- Tue May 30, 2006 1:16 am
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 18832
overflow ??
I got WA in 0.6s. I think it is because that product of two very large integers is larger than MAXINT. And i tried use a double and then change to integer, it seems not enough precise. Can anyone give any hints for that ? How i can save that big number correctly or avoid saving such big number?? Tha...
- Thu May 25, 2006 11:54 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11008 - Antimatter Ray Clearcutting
- Replies: 81
- Views: 45139
- Thu May 18, 2006 4:07 am
- Forum: Volume 110 (11000-11099)
- Topic: 11031 - Looking for a Subset
- Replies: 24
- Views: 17935
To Timo and sohel: Thanks for the idea, I will try once again in the next few days!! :lol: :oops: To Jan: :wink: It seems that I am lucky. Well I can also try once again to submit with my current solution after u set a new input file and to see if your input is good enough 8) 8) I got ACC by using a...
- Tue May 16, 2006 11:01 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11033 - Help my Brother
- Replies: 5
- Views: 2442
- Tue May 16, 2006 8:12 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11033 - Help my Brother
- Replies: 5
- Views: 2442
11033 - Help my Brother
I need some more I/O. PLZ Help.
And I used a ugly method and got WA at about 2 CPU time, which already exceeded the contest time constraints. Any hint I will also be appreciate.
Thanks.
And I used a ugly method and got WA at about 2 CPU time, which already exceeded the contest time constraints. Any hint I will also be appreciate.
Thanks.
- Tue May 16, 2006 6:18 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11028 - Sum of Product
- Replies: 24
- Views: 13218
ooops... :oops: no you don't have time to generate all the permutations. One hint: Look at the AC times of everyone.. most 0.00 sec(and that's without precalculation) Hope i am talking about the right problem this time... :D I have got accepted :lol: I think people have solved in the same way I did...
- Tue May 16, 2006 6:01 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11031 - Looking for a Subset
- Replies: 24
- Views: 17935
How can it be proved??
Well my code used 5.070 CPU time. And I use a o(n^2) algorithm,
and i see the ranklist almost all codes run under 1 CPU time, how can i do that? can anyone suggest any better ones ?
and i see the ranklist almost all codes run under 1 CPU time, how can i do that? can anyone suggest any better ones ?