Submission #530100

#TimeUsernameProblemLanguageResultExecution timeMemory
530100tkwiatkowskiRack (eJOI19_rack)Cpython 3
100 / 100
322 ms2844 KiB
MOD = 10**9 + 7 def solve(): n, k = map(int, input().split()) k -= 1 ans = 1 for i in range(n): if (k % 2 == 0): ans = (2*ans) % MOD else: ans = (2*ans + 1) % MOD k //= 2; pow2 = 1 for i in range(n): pow2 = (2*pow2) % MOD print((ans - pow2 + 1) % MOD) solve()
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...