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

Автор k4droid3, история, 3 года назад, По-английски

As the title says.
GNU C++17 (64)
GNU C++17

not only that,
running the first test case in custom invocation:
GNU G++17 ----------> 15000 ms [timed out]
GNU G++14 ----------> 5000 ms
GNU G++11 ----------> 0 ms
GNU G++17 (64) -----> 31 ms

what sorcery is this? help!

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

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

adding
#include <cmath>
and changing
while(r <= __lg(k)) {
to
while(r <= log2(k)) {
fixed the problem of TLE. I assume the answer would also be correct but I have not submitted; it does pass the sample, though.

You might want to further research __lg().