# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1151120 | yamtllq | Rack (eJOI19_rack) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
int n;
long long k;
cin >> n >> k;
k--;
long long reversed = 0;
for (int i = 0; i < n; ++i) {
reversed = (reversed << 1) | ((k >> i) & 1);
reversed %= mod;
}
cout << (reversed + 1) % mod << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |