Submission #290826

#TimeUsernameProblemLanguageResultExecution timeMemory
290826gs14004CATS (NOI14_cats)C++17
Compilation error
0 ms0 KiB
#include <cstdio> using lint = long long; int main(){ int q; lint x, l, n; scanf("%d",&q); while (q--) { scanf("%lld %lld %lld",&x,&l,&n); x--; n <<= 1; lint Q = l / n + 2; x %= (1ll << min(Q, 61ll)); printf("%lld\n", (Q - 1) * n +__builtin_popcountll(x) % 2); } }

Compilation message (stderr)

cats.cpp: In function 'int main()':
cats.cpp:12:21: error: 'min' was not declared in this scope; did you mean 'main'?
   12 |        x %= (1ll << min(Q, 61ll));
      |                     ^~~
      |                     main
cats.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    7 |  scanf("%d",&q);
      |  ~~~~~^~~~~~~~~
cats.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |   scanf("%lld %lld %lld",&x,&l,&n);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~