Submission #466203

#TimeUsernameProblemLanguageResultExecution timeMemory
466203HalitRack (eJOI19_rack)C++17
100 / 100
5 ms204 KiB
// author: Halit #include <bits/stdc++.h> int main() { int64_t n, k; std::cin >> n >> k; int64_t res = 1, pow = 1, mod = 1e9 + 7; for (int i = 1;i <= n; ++i, (k = (k+1)/2)) { if (k % 2 == 0) res = (res<<1|1)%mod; else res = (res<<1)%mod; pow = (pow * 2) % mod; } pow = (pow - 1 + mod) % mod; res = (res - pow + mod) % mod; std::cout << res << std::endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...