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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
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