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 | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 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://mirror.codeforces.com/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?
Название |
---|