답안 #548694

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

using namespace std;

const int mod = 1000000007;
int 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 % mod;
    j = 1;
    for (int a = 1; a <= n; a++)
    {
        j = (j % mod) * 2;
    }

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

    cout << i;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 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 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 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 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 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 Incorrect 0 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -