Submission #533300

#TimeUsernameProblemLanguageResultExecution timeMemory
533300stasicoRack (eJOI19_rack)C++17
100 / 100
10 ms316 KiB
#include <bits/stdc++.h> using namespace std; const int Mod=1e9+7; int main() { ios_base::sync_with_stdio(0), cin.tie(0); int n,i,w=1,p=1; long long k; cin >> n >> k; --k; for (i=1; i<=n; i++) { if (k%2==0) w=((long long)2*w)%Mod; else w=((long long)2*w+1)%Mod; k=k/2; } for (i=1; i<=n; i++) p=((long long)2*p)%Mod; cout << (w-(p-1)+Mod)%Mod << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...