Codeforces и Polygon могут быть недоступны в период с 6 декабря, 22:00 (МСК) по 7 декабря, 00:00 (МСК) в связи с проведением технических работ. ×

Блог пользователя fofao_funk

Автор fofao_funk, 8 лет назад, По-английски

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:

C++11, C++14

Problem 2:

C++11, C++14

What is the issue?

Appreciate the help!

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

You've used "%lld" in scanf,which is not supported by old version of mingw while using c++11 standard.So the mod you 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 %I64d

  • »
    »
    8 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    I think this is not the issue: I submitted another code with only the function g changed and it got accepted. Besides that, I've always used %lld with C++11 and it was never an issue.

    I also tested with %I64d and got TLE: 22112022