Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

Автор pimenta, история, 7 лет назад, По-английски

Hi,

I've wrote a solution for problem 883K - Road Widening in C++11 and Golang. C++11 runs in 156 ms, but Golang gets TLE (3000 ms).

C++11: 31844450

Golang: 31844038

Why? Did I do something wrong in the Golang implementation, increasing the time complexity?

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

»
7 лет назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

What is Golang?

»
7 лет назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

Nevermind, just found the explanation here.

Same golang code with buffered input gets 1294 ms (AC): 31845683.

With both input and output being buffered, 390 ms: 31845737.