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!
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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.net/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?
Название |
---|