Problem : Link. I simply did bfs from node 1 and found the maximum distance from this node to all other nodes
Code
So the solution is O(n+m) but still, there is TLE in one case. Why?
CSES Longest Flight Route TLE in one test case
Problem : Link. I simply did bfs from node 1 and found the maximum distance from this node to all other nodes
So the solution is O(n+m) but still, there is TLE in one case. Why?
| Rev. | Lang. | By | When | Δ | Comment | |
|---|---|---|---|---|---|---|
| en5 |
|
salt_n_ice | 2020-12-03 13:46:13 | 56 | ||
| en4 |
|
salt_n_ice | 2020-12-03 13:45:53 | 62 | Tiny change: 'Problem : ' -> '<spoiler summary="Spoiler">\n...\n..testing\n</spoiler>\nProblem : ' | |
| en3 |
|
salt_n_ice | 2020-12-03 13:41:51 | 16 | ||
| en2 |
|
salt_n_ice | 2020-12-03 13:40:55 | 73 | ||
| en1 |
|
salt_n_ice | 2020-12-03 13:39:52 | 1329 | Initial revision (published) |