Submission #1001314

# Submission time Handle Problem Language Result Execution time Memory
1001314 2024-06-18T18:38:33 Z vjudge1 Rack (eJOI19_rack) C++17
0 / 100
1 ms 348 KB
#include <bits/stdc++.h>

using namespace std;



int main()
{
    long long n,k;
    cin>>n>>k;
    long long res=1;
    for(long long n1=n;n1>0;n1--)
    {
        res=res*2;
    }
    if(k==1)
    {
        cout<<1;
        return 0;

    }

    k--;
    for(long long br=1;;br=br*2)
    {
        if(k<=br)
        {
            int br2=br/2,br3;
            if(k%2==0)
            {
                br3=br2+k/2;
            }
            else
            {
                br3=k/2+1;
            }

            res=res/br;
            cout<<res*(br3-1)+res/2+1;
            return 0;

        }
        else
            k=k-br;
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -