Submission #838091

#TimeUsernameProblemLanguageResultExecution timeMemory
838091BlockOGRack (eJOI19_rack)C++14
100 / 100
6 ms4052 KiB
#include <iostream> using namespace std; int main() { int n; long long k; cin >> n >> k; k--; int t[n]; t[0] = 1; for (int i = 1, j = 1; i <= n; i++) { j *= 2; j %= 1000000007; t[i] = j; } int res = 0; for (int i = n - 1; i >= 0; i--) { if (k & 1) { res += t[i]; res %= 1000000007; } k >>= 1; } cout << res + 1 << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...