Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Comments
On fire_bot → Java TLE but C++ AC.. Why?, 13 years ago
0

Thanks for the help! :)

On fire_bot → Java TLE but C++ AC.. Why?, 13 years ago
+9

I guess case is SOLVED. :) Thanks everyone who commented and helped me on this! It was a great learning curve :)

On fire_bot → Java TLE but C++ AC.. Why?, 13 years ago
0

Yes you are right. I tried it myself. Got Accepted JAVA 0.669. Though also tried used BufferedOutputStream in conjunction.

Also about WA this is a fix:


else if (N == 0) { inc = new int[][] { { N, M }, { N, -M}, {M, N}, {-M, N}}; } else if (M == 0) { inc = new int[][] { { N, M }, {-N, M}, {M, N}, {M, -N} }; }