This is my solution for 86D : Powerful Array. Link: http://ideone.com/618TcS
This gave me a TLE at test 6, taking more than 5000 ms whereas most AC solutions pass at 800 — 1000 ms. How do I optimize my code? Thanks in advance!
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | orzdevinwang | 3844 |
3 | jqdai0815 | 3682 |
4 | jiangly | 3618 |
5 | Benq | 3529 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3443 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | atcoder_official | 162 |
3 | maomao90 | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | djm03178 | 152 |
This is my solution for 86D : Powerful Array. Link: http://ideone.com/618TcS
This gave me a TLE at test 6, taking more than 5000 ms whereas most AC solutions pass at 800 — 1000 ms. How do I optimize my code? Thanks in advance!
I found this question in Codeforces Round #373 (Div. 2).
http://codeforces.me/problemset/problem/719/B
My solution:
Can someone please help me find why my solution fails and how to correct it accordingly?
Thanks in advance!
Here is my solution to SPOJ Problem CHAIN : https://ideone.com/Egu19B
My solution involves maintaining 3 arrays, for containing the root node of each disjoint set as well as the root nodes of predator and prey of that disjoint set. The solution gives a WA, I've verified it for a lot of test cases and am unable to understand why it fails. Can anybody tell me where my solution fails, perhaps even provide me with a test case where it does not work?
The problem : http://www.spoj.com/problems/CHAIN/
Thanks!
My code : https://ideone.com/QJtb9E . My bottom up solution gives WA. If possible, can someone provide me with test cases where it fails? Thanks!
NHAY is a SPOJ question involving pattern search. The Link: http://www.spoj.com/problems/NHAY/
My solution gives me TLE. Here is my code: https://ideone.com/A2N6An What are some optimizations that I can apply on my code?
Name |
---|