# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1229178 | 1zaid1 | Rack (eJOI19_rack) | Pypy 3 | 173 ms | 125088 KiB |
M = 1000000007
p = [1]
for i in range(1000000):
p.append((2*p[-1])%M)
def f(n, x):
if (n == 0):
return x
if x%2 == 1:
return f(n-1, (x+1)//2)
else:
return (p[n] + f(n-1, x//2))%M
k, x = input().split(' ')
x = int(x)
k = int(k)
print(f(k-1, x))
컴파일 시 표준 출력 (stdout) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |