제출 #448770

#제출 시각아이디문제언어결과실행 시간메모리
448770UltraFalconRack (eJOI19_rack)C++17
40 / 100
1 ms460 KiB
#include <bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    const int limit = (1e9) + 7;

    int n, k;
    cin >> n >> k;

    k--;
    int i = n-1;
    int r = 1;

    while (i >= 0) {
        if (k % 2 == 1) {
            assert(i < 33);
            r = (r + ((1ll << i) % limit)) % limit;
        }
        k /= 2;
        i--;
    }
    cout << r % limit << "\n";
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...