k4droid3's blog

By k4droid3, history, 3 years ago, In English

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!

  • Vote: I like it
  • +16
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it +8 Vote: I do not like it

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().