I get this when i submit code —
but when i run my exact same testcase in test against custom input window i get —
which is the correct output.
here is my submission — Submission
what am i doing wrong?
# | User | Rating |
---|---|---|
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 |
# | User | Contrib. |
---|---|---|
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 |
I get this when i submit code —
but when i run my exact same testcase in test against custom input window i get —
which is the correct output.
here is my submission — Submission
what am i doing wrong?
Name |
---|
Maybe it is occurring because of the global stuff you have declared . Not resetting them for each test case would lead to problems.
I tried clearing global variables but now it gives TLE :< Submission
Make things local, pass things by reference in your helper functions.
ok , but i don't find anything wrong in declaring it global and clearing it for testcases , why would it anyway lead to TLE , but declaring it each time locally would pass?
I have not went through your code, but see suppose you have
, as graph adjacency list representation of graph and N is of 1e5 order. You have made it global.
Clearing it whole for each case till N may give you TLE.
But if you clear it till your required input n, then it may not give TLE.
I have faced TLE lot of time because of clearing everytime time for whole graph.
So either clear till n(given input size) or make it local and pass it by reference in required helper functions.
Sorry I havent seen your code, I will see it later.
don't get it
not got any reason