Submission #1111563

#TimeUsernameProblemLanguageResultExecution timeMemory
1111563BananabreadCATS (NOI14_cats)C++17
25 / 25
294 ms7916 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll q; cin>>q; while(q--){ ll k,l,n; cin>>k>>l>>n; k--; ll c=(l/(2*n)+2); if(c>62) c=62; k%=(1LL<<c); cout<<2*n*(l/(2*n)+1)+(__builtin_popcountll(k)%2)<<"\n"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...