답안 #548688

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
548688 2022-04-14T09:14:15 Z Stavab Rack (eJOI19_rack) C++14
40 / 100
1000 ms 212 KB
#include <bits/stdc++.h>

using namespace std;

unsigned long long i, j, k;

void narrow (int lower, int upper)
{
    if (k % 2 == 0)
    {
        lower = (upper + lower) / 2 + 1;
        k /= 2;
    }
    else
    {
        upper = (upper + lower) / 2;
        k /= 2;
        k++;
    }
    
    i = lower;
    j = upper;
}

int main()
{
    int n;
    cin >> n >> k;

    i = 1;
    j = pow(2, n);

    while (j != i)
    {
        narrow(i, j);
    }

    cout << i;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Execution timed out 1093 ms 212 KB Time limit exceeded
12 Halted 0 ms 0 KB -