|
|
back to boardFor C++ Users I got TLE for both, straightforward sort-solution (n*logn) and Moore's algorithm (n). You can avoid it using this line in your code: - ios_base::sync_with_stdio(false); Commands "cout" and "cin" are immensely slow and for large inputs, your code can get TLE. Surprisingly, both approaches differ from each other only by 0.02 sec (with the aforementioned line included). |
|
|