Submission #696499

#TimeUsernameProblemLanguageResultExecution timeMemory
696499HanksburgerRack (eJOI19_rack)C++17
100 / 100
7 ms7892 KiB
#include <bits/stdc++.h> using namespace std; const long long mod=1e9+7; long long a[1000005]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n, k, ans=0; cin >> n >> k; a[0]=1; for (long long i=1; i<=n; i++) a[i]=a[i-1]*2%mod; for (long long i=0; i<=59; i++) if ((k-1)&(1LL<<i)) ans=(ans+a[n-i-1])%mod; cout << (ans+1)%mod; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...