제출 #548687

#제출 시각아이디문제언어결과실행 시간메모리
548687StavabRack (eJOI19_rack)C++14
40 / 100
1 ms300 KiB
#include <bits/stdc++.h> using namespace std; 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; j = pow(2, n); while (j != i) { narrow(i, j); } cout << i; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...