Submission #1111672

#TimeUsernameProblemLanguageResultExecution timeMemory
1111672BananabreadCATS (NOI14_cats)C++17
25 / 25
49 ms7752 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); 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...