Hello, I was recently coding a problem and my approach was correct. But I was using all variables in the form of long long int. I had used
#define int long long.
In this problem, it was not necessary to use long long.
I submitted code and result was TLE. And I observed that the time taken was above 3200 ms in cp editor. Then after scratching my head for 1 hour, I atlast went for other users' solutions. The only difference was they used int and approach was the same. I did the same. I deleted this line
#define int long long. The time taken was now slightly above 2500 ms. I submitted the code and it was accepted.
Bonus questions : My second successful code was taking time above of 2500ms in my local machine(in cp editor). But the time constraint of that problem was 2 seconds. Why was the code accepted? The problem was from cses problem set. Are there any relatively similar incidents that occurred to you? I would be happy to know some, especially in codeforces platform?