Hi all.
This week I solved two problems here on codeforces, both on C++. For my surprise, in those two problems, I received TLE as a verdict on really small testcases when using GNU C++11 as a language. The solutions for those tests were running pretty fast on my machine, so I decided to submit them with GNU C++14; surprisingly, those solutions were accepted, having really small execution time on the said tests.
Problem 1:
Problem 2:
What is the issue?
Appreciate the help!









You've used "%lld" in scanf,which is not supported by old version of mingw while using c++11 standard.So the
modyou read might be an invaild number which caused TLE.But c++14 works with "%lld" well.More information about c++14 Codeforces: С++14 is supported
There mentions
works correctly to read-write long long both with %lld and %I64dI think this is not the issue: I submitted another code with only the function
gchanged and it got accepted. Besides that, I've always used%lldwith C++11 and it was never an issue.I also tested with
%I64dand got TLE: 22112022