제출 #441419

#제출 시각아이디문제언어결과실행 시간메모리
441419RaresFelixRack (eJOI19_rack)C++17
100 / 100
10 ms316 KiB
#include <bits/stdc++.h>
#define MOD 1000000007ll
#define int long long
using namespace std;
int n, k, re;
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;
	cin >> n >> k;
	--k;
	re = 0;
	//vom inversa pe k
    for(int i = 1; i <= n; ++i)
	{
		re = (re * 2 % MOD + k%2) % MOD;
		k /= 2;
	}
	cout << (re+1)%MOD << "\n";
    return 0;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...