Submission #1111561

# Submission time Handle Problem Language Result Execution time Memory
1111561 2024-11-12T09:36:49 Z Bananabread CATS (NOI14_cats) C++17
16 / 25
287 ms 2252 KB
#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%=(1<<c);
        cout<<2*n*(l/(2*n)+1)+(__builtin_popcountll(k)%2)<<"\n";
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 3 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 336 KB Output is correct
2 Correct 3 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 336 KB Output is correct
2 Incorrect 25 ms 592 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 287 ms 2252 KB Output isn't correct
2 Halted 0 ms 0 KB -