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

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

In Problem D-Bandit in a City (Codeforces Round 678), the binary search solution has complexity of O(Nlog(2e14)), where N=2e5, So, it should take around 100ms, but most of submissions using binary search, like this are taking more than 900ms. Can anyone tell why is this happening?

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

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

Probably significant amount of this time is input
I don't know expected performance of cin with magic incantations, but there are 400000 values to be read

»
5 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится +3 Проголосовать: не нравится

2e5 * log(1e14) = 1e7

Also there is a really big constant in front of it. There are lots of operations and there is recursion
Also there are lots of random jumps that may make processor caching ineffective
Also there is a huge input
I believe it is a combination of all those factors