Today when I upsolving 1768F - Wonderful Jump in which the intended solution is pretty simple. But the time complexity is O(n^1.5) and n=4*10^5 the time limit is pretty strict. I implemented the intended solution in java for many times but I always got TLE. Then I copied the submission 188424856 _(483ms) which is simpler the the official solution, and implemented in java, and got AC for 3322ms (My submission:188904779). It seems that sometimes you must to optimize the solution further than intended.
Also the official judge runs java code much more slowly than on my computer. I tested for cases where a[i]=1+(i%mod), where mod was about sqrt(400000). The code ran for about 0.6s but for the similar cases of the official judge it ran for about 2.3s.