In the last round in Educational Codeforces Round 130 (рейтинговый для Div. 2) i solved 1697C - Любимая задача awoo with complexity $$$O(N^2)$$$ by compiler GNU C++20 (64) i wonder how i didn't get TLE, I don't know if there is solution with complexity $$$O(N^2)$$$ or if the tests wasn't good in this problem, also i submited it with compiler GNU C++17 (64) and got accepted ,But i submited it with compiler GNU C++17 and got TLE (Time limit exceeded).
Submissions :
How does it happen ?? Why GNU C++17 (64) and GNU C++20 (64) is better than GNU C++17 ?? How my solution with complexity $$$O(N^2)$$$ works ??
thanks.