Why is TLE in this codeforces problem? https://codeforces.com/contest/1352/problem/E

First, format code or just link your submission that TLE’s (better option)

Map is just slow in this problem, you probably aren’t intended to use it, especially when n = 8000. There are multiple better approaches.

1 Like