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: 37877
- Sat Jun 10, 2006 12:04 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11047 - The Scrooge Co Problem
- Replies: 31
- Views: 19992
- Tue Jun 06, 2006 9:07 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11045 - My T-shirt suits me
- Replies: 18
- Views: 14102
- Tue Jun 06, 2006 8:30 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11047 - The Scrooge Co Problem
- Replies: 31
- Views: 19992
- Tue Jun 06, 2006 5:19 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11047 - The Scrooge Co Problem
- Replies: 31
- Views: 19992
- Wed May 31, 2006 9:30 am
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 24082
- Tue May 30, 2006 2:25 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 24082
- Tue May 30, 2006 9:42 am
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 24082
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 ...
- Tue May 30, 2006 1:16 am
- Forum: Volume 110 (11000-11099)
- Topic: 11026 - A Grouping Problem
- Replies: 28
- Views: 24082
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 ...
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 ...
- Thu May 25, 2006 11:54 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11008 - Antimatter Ray Clearcutting
- Replies: 81
- Views: 86419
- Thu May 18, 2006 4:07 am
- Forum: Volume 110 (11000-11099)
- Topic: 11031 - Looking for a Subset
- Replies: 24
- Views: 22212
- Tue May 16, 2006 11:01 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11033 - Help my Brother
- Replies: 5
- Views: 2971
- Tue May 16, 2006 8:12 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11033 - Help my Brother
- Replies: 5
- Views: 2971
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: 15004
- Tue May 16, 2006 6:01 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11031 - Looking for a Subset
- Replies: 24
- Views: 22212
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 ?