problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02786 | H = int(input())
def calc(H):
if H == 0:
return 1
else:
return calc(H//2)*2+1
print(calc(H)) | H = int(input())
def calc(H):
if H == 1:
return 1
else:
return calc(H//2)*2+1
print(calc(H))
| [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 589,715 | 589,716 | u904804404 | python |
p02786 | H = int(input())
def calc(H):
if H == 0:
return 1
else:
return calc(H//2)*2
print(calc(H)) | H = int(input())
def calc(H):
if H == 1:
return 1
else:
return calc(H//2)*2+1
print(calc(H))
| [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 589,717 | 589,716 | u904804404 | python |
p02786 | def hel(h):
if h==0:
return 1
else:
return (2*hel(int(h/2))+1)
health=int(input())
print(hel(health))
| def hel(h):
if h==1:
return 1
else:
return (2*hel(int(h/2))+1)
health=int(input())
print(hel(health))
| [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 589,720 | 589,721 | u753092134 | python |
p02786 | H = int(input())
def attack(x):
if H > 0:
return 2 * attack(int(x/2)) + 1
else:
return 1
print(attack(H))
| H = int(input())
def attack(x):
if x > 1:
return attack(int(x/2)) * 2 + 1
else:
return 1
print(attack(H)) | [
"identifier.change",
"control_flow.branch.if.condition.change",
"literal.number.integer.change",
"expression.operation.binary.remove"
] | 589,724 | 589,725 | u273496671 | python |
p02786 | def f(h):
if h==1:
return 1
else:
return f[h//2]*2+1
print(f(int(input()))) | def f(h):
if h==1:
return 1
else:
return f(h//2)*2+1
print(f(int(input()))) | [
"function.return_value.change",
"expression.operation.binary.change"
] | 589,728 | 589,729 | u859897687 | python |
p02786 | val=int(input())
ans=0
while val>1:
val/=2
ans+=1
ans=2**ans-1
print(ans) | val=int(input())
ans=0
while val>=1:
val/=2
ans+=1
ans=2**ans-1
print(ans) | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 589,741 | 589,742 | u222643068 | python |
p02786 | H = int(input())
print(H)
def ref(H,d):
d = d+1
if 1 < H:
H, d = ref(H/2,d*2)
return H, d
_, d = ref(H,0)
print(d) | H = int(input())
def ref(H,d):
d = d+1
if 1 < H:
H, d = ref(H//2,d*2)
return H, d
_, d = ref(H,0)
print(d) | [
"call.remove",
"expression.operator.arithmetic.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 589,743 | 589,744 | u539874256 | python |
p02786 | import math
H = map(int,input().split())
ans=sum([2**int(1+math.ceil(math.log2(s)))-1 for s in H])
print(ans) | import math
H = map(int,input().split())
ans=sum([2**int(1+math.floor(math.log2(s)))-1 for s in H])
print(ans) | [
"misc.opposites",
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 589,753 | 589,754 | u006251926 | python |
p02786 | H = input()
i = 0
while 2 ** i <= H:
i += 1
print(2 ** i - 1) | H = input()
i = 0
while 2 ** i <= int(H):
i += 1
print(2 ** i - 1)
| [
"control_flow.loop.condition.change",
"call.add"
] | 589,763 | 589,764 | u370721525 | python |
p02786 | def f(x):
if x == 1:
return 1
else:
return 2 * f(H // 2) + 1
H = int(input())
min = f(H)
print(min) | def f(x):
if x == 1:
return 1
else:
return 2 * f(x // 2) + 1
H = int(input())
min = f(H)
print(min) | [
"identifier.change",
"call.arguments.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 589,772 | 589,773 | u697101155 | python |
p02786 | H = int(input())
c = 1
while H >= 2**c:
c += 2
print(2 ** c - 1) | H = int(input())
c = 1
while H >= 2**c:
c += 1
print(2 ** c - 1) | [
"literal.number.integer.change"
] | 589,786 | 589,787 | u701318346 | python |
p02786 | import math
h = int(input())
k = (math.log2(h))
print((2**(k+1)-1)) | import math
h = int(input())
k = int(math.log2(h))
print((2**(k+1)-1)) | [
"call.add",
"type_conversion.to_integer.change",
"type_conversion.to_number.change"
] | 589,788 | 589,789 | u046592970 | python |
p02786 | def attack_count(N):
if N == 1:
return 1
else:
return 2 * attack_count(N//2)
H = int(input())
print(attack_count(H))
| def attack_count(N):
if N == 1:
return 1
else:
return 2 * attack_count(N//2) + 1
H = int(input())
print(attack_count(H))
| [
"expression.operation.binary.add"
] | 589,790 | 589,791 | u767664985 | python |
p02786 | h = input()
count = 0
count_1 = 1
count_2 = 1
while True:
if h == 1:
print(count_2)
break
else:
h = h // 2
count_1 = count_1 * 2
count_2 += count_1 | h = int(input())
count = 0
count_1 = 1
count_2 = 1
while True:
if h == 1:
print(count_2)
break
else:
h = h // 2
count_1 = count_1 * 2
count_2 += count_1 | [
"call.add",
"call.arguments.change"
] | 589,798 | 589,799 | u602267597 | python |
p02786 | h = int(input())
num = 1
cnt = 0
while True:
cnt += num
h >>= 1
num *= 2
if h:
continue
print(num)
break | h = int(input())
num = 1
cnt = 0
while True:
cnt += num
h >>= 1
num *= 2
if h:
continue
print(cnt)
break | [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 589,800 | 589,801 | u694433776 | python |
p02786 | H = int(input())
i=1
while True:
A=2**i
if H==A:
jo=i
break
elif H<A:
jo=i-1
break
i+=1
for j in range(0,jo+1):
result=result+2**j
print(result) | H = int(input())
#Hは2のjo乗より小さい
i=1
while True:
A=2**i
if H==A:
jo=i
break
elif H<A:
jo=i-1
break
i+=1
result=0
for j in range(0,jo+1):
result=result+2**j
print(result) | [
"assignment.add"
] | 589,855 | 589,856 | u017603316 | python |
p02786 | import math
print(2**(math.ceil(math.log(float(input()),2)))-1) | import math
print(2**(math.ceil(math.log2(float(input())+1)))-1) | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 589,865 | 589,864 | u440161695 | python |
p02786 | import numpy as np
H = int(input())
print(2 ** (int(np.log2(1000000000000)) + 1) - 1) | import numpy as np
H = int(input())
print(2 ** (int(np.log2(H)) + 1) - 1) | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"expression.operation.binary.change"
] | 589,868 | 589,869 | u978933721 | python |
p02786 | H, ans, n = int(input()), 0, 1
while H == 0:
ans, n, H = ans + n, n ** 2, H // 2
print(ans)
| H, ans, n = int(input()), 0, 1
while H != 0:
ans, n, H = ans + n, n * 2, H // 2
print(ans)
| [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.loop.condition.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 589,870 | 589,871 | u655110382 | python |
p02786 | import math
H=int(input())
sum([2**x for x in range(math.floor(math.log2(H))+1)]) | import math
H=int(input())
print(sum([2**x for x in range(math.floor(math.log2(H))+1)])) | [
"call.add",
"call.arguments.change"
] | 589,903 | 589,904 | u891438775 | python |
p02786 | n = int(input())
ans = 1
n //= 2
i = 1
while n > 0:
ans += i * 2
n //= 2
i += 1
print(ans)
| n = int(input())
ans = 1
n //= 2
i = 1
while n > 0:
ans += 2 ** i
n //= 2
i += 1
print(ans) | [
"expression.operation.binary.remove"
] | 589,918 | 589,919 | u638339796 | python |
p02786 | h = int(input())
def Count(a):
if a==1:
return 1
return 1+2*Count(a//2)
print(Count(a)) | h = int(input())
def Count(a):
if a==1:
return 1
return 1+2*Count(a//2)
print(Count(h)) | [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 589,937 | 589,938 | u516927307 | python |
p02786 | h = int(input())
def Count(a):
if a==1:
return 1
return 1+2*count(a//2)
print(Count(a)) | h = int(input())
def Count(a):
if a==1:
return 1
return 1+2*Count(a//2)
print(Count(h)) | [
"identifier.change",
"call.function.change",
"function.return_value.change",
"expression.operation.binary.change",
"call.arguments.change",
"io.output.change"
] | 589,939 | 589,938 | u516927307 | python |
p02786 | import math
H = input()
m = math.ceil(math.log2(int(H)))
n = int(math.pow(2, m) - 1)
print(n) | import math
H = input()
m = math.ceil(math.log2(int(H) + 1))
n = int(math.pow(2, m) - 1)
print(n) | [
"assignment.change"
] | 589,944 | 589,945 | u595981869 | python |
p02786 | h = int(input())
cnt = 0
if h == 1:
print(1)
while h > 1:
h = h // 2
cnt += 1
print(2**(cnt+1)-1) | h = int(input())
cnt = 0
if h == 1:
print(1)
quit()
while h > 1:
h = h // 2
cnt += 1
print(2**(cnt+1)-1) | [
"call.add"
] | 589,971 | 589,972 | u948911484 | python |
p02786 | import math
res = 0
num_enemy = 1
n = int(input())
while True:
res += num_enemy
if n==1:
break
num_enemy *= 2
n = n//2
res | res = 0
num_enemy = 1
n = int(input())
while True:
res += num_enemy
if n==1:
break
num_enemy *= 2
n = n//2
print(res) | [
"call.add",
"call.arguments.change"
] | 589,973 | 589,974 | u833337336 | python |
p02786 | hp = int(input())
count = 0
while hp > 0:
if hp == 1:
hp -= 1
else:
hp = hp // 2
a = 2 ** hp -1
print(a) | hp = int(input())
count = 0
while hp > 0:
count += 1
if hp == 1:
hp -= 1
else:
hp = hp // 2
a = 2 ** count -1
print(a) | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 589,975 | 589,976 | u501451051 | python |
p02786 | S=int(input())
ANS=0
if S <= 1:
print(1)
else:
ANS=1
while 2**ANS <= S:
ANS += 1
print(ANS**2-1) | S=int(input())
ANS=0
if S <= 1:
print(1)
else:
ANS=1
while 2**ANS <= S:
ANS += 1
#print(ANS**2)
print(2**ANS-1)
| [
"expression.operation.binary.remove"
] | 589,989 | 589,990 | u578953945 | python |
p02786 | import math
H = int(input())
count = int((1-2**(math.log2(H)+1)) * -1)
print(count) | import math
H = int(input())
count = int((1-2**(math.floor(math.log2(H))+1)) * -1)
print(count) | [
"call.add",
"call.arguments.change"
] | 590,003 | 590,004 | u004423772 | python |
p02786 | n = int(input())
a = []
cur = 1
while cur <= n:
a.append(cur)
cur *= 2
print(sum(cur)) | n = int(input())
a = []
cur = 1
while cur <= n:
a.append(cur)
cur *= 2
print(sum(a)) | [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 590,013 | 590,014 | u569195503 | python |
p02786 | h = int(input())
ans = 0
while True:
if h == 1:
break
elif h == 2:
ans += 1
break
else:
h //= 2
ans += 1
print(2**ans) | h = int(input())
ans = 0
while True:
if h == 1:
break
elif h == 2:
ans += 1
break
else:
h //= 2
ans += 1
print(2**(ans+1)-1) | [
"call.arguments.change",
"call.arguments.add"
] | 590,015 | 590,016 | u740284863 | python |
p02786 | H = int(input())
s = 1
while H!=0:
H = divmod(H, 2)[0]
s *= 2
s = s / 2
print(int(s + p))
| H = int(input())
s = 1
while H!=0:
H = divmod(H, 2)[0]
s *= 2
s = s / 2
p = s - 1
print(int(s + p))
| [
"assignment.add"
] | 590,027 | 590,028 | u038408819 | python |
p02786 | h = input()
score = 0
fak = 1
while h>1:
score += fak
h = int(h/2)
fak *= 2
print(score+1) | h = int(input())
score = 0
fak = 1
while h>1:
score += fak
h = int(h/2)
fak *= 2
print(score+fak) | [
"call.add",
"call.arguments.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change",
"io.output.change"
] | 590,031 | 590,032 | u218071226 | python |
p02786 | H=int(input())
import math
H=int(math.log2())
print(2**(H+1)) | H=int(input())
import math
H=int(math.log2(H))
print(2**(H+1)-1) | [
"call.arguments.change"
] | 590,033 | 590,034 | u267267582 | python |
p02786 | H=int(input())
import math
H=int(math.log1())
print(2**(H+1)) | H=int(input())
import math
H=int(math.log2(H))
print(2**(H+1)-1) | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 590,035 | 590,034 | u267267582 | python |
p02786 | # coding utf-8
import math
H = int(input())
max_h = 10**12
n = 1
while H > 1:
H //= 2
n += 1
print(H)
print((2**n)-1)
| # coding utf-8
import math
H = int(input())
max_h = 10**12
n = 1
while H > 1:
H //= 2
n += 1
print((2**n)-1)
| [
"call.remove"
] | 590,049 | 590,050 | u507621996 | python |
p02786 | a=int(input())
count=0
s=1
while True:
if a>1:
a//=int(2)
count+=1
s+=2**count
else:
s+=2**count
print(s)
break
| a=int(input())
count=0
s=0
while True:
if a>1:
a//=int(2)
count+=1
s+=2**count
else:
s+=1
print(s)
break | [
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 590,056 | 590,057 | u711626986 | python |
p02786 | a=int(input())
k=2
while a>k:k*=2
print(k-1) | a=int(input())
k=2
while a>=k:k*=2
print(k-1) | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 590,064 | 590,065 | u623819879 | python |
p02786 | H = int(input())
x = 2
for i in range(50):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if x == 1:
ans = 1
print(ans) | H = int(input())
x = 2
for i in range(41):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if H == 1:
ans = 1
print(ans) | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 590,084 | 590,085 | u674951726 | python |
p02786 | H = int(input())
x = 2
for i in range(42):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if x == 1:
ans = 1
print(ans) | H = int(input())
x = 2
for i in range(41):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if H == 1:
ans = 1
print(ans) | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 590,086 | 590,085 | u674951726 | python |
p02786 | H = int(input())
x = 2
for i in range(41):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if x == 1:
ans = 1
print(ans) | H = int(input())
x = 2
for i in range(41):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if H == 1:
ans = 1
print(ans) | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 590,087 | 590,085 | u674951726 | python |
p02786 | H = int(input())
x = 2
for i in range(40):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if x == 1:
ans = 1
print(ans) | H = int(input())
x = 2
for i in range(41):
if x <= H and x*2 > H:
ans = x*2 - 1
break
x = x*2
if H == 1:
ans = 1
print(ans) | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 590,088 | 590,085 | u674951726 | python |
p02786 | def main():
H = int(input())
def f(x):
if x == 1:
return 1
return 2 * f(x//2)
print(f(H))
if __name__ == '__main__':
main()
| def main():
H = int(input())
def f(x):
if x == 1:
return 1
return 2 * f(x//2) + 1
print(f(H))
if __name__ == '__main__':
main()
| [
"expression.operation.binary.add"
] | 590,091 | 590,093 | u312025627 | python |
p02786 | h = int(input())
def count(h):
if(h==0):
return 0
if(h==1):
return 1
return 1 + 2*count(h/2)
print(count(h))
| h = int(input())
def count1(h):
if(h==0):
return 0
if(h==1):
return 1
return 1 + 2*count1(h//2)
print(count1(h)) | [
"identifier.change",
"call.function.change",
"function.return_value.change",
"expression.operation.binary.change",
"expression.operator.arithmetic.change",
"call.arguments.change",
"io.output.change"
] | 590,096 | 590,097 | u130587994 | python |
p02786 | import math
h = int(input())
print(2**(math.ceil(math.log(h,2))+1)-1) | import math
h = int(input())
print(2**(math.floor(math.log(h,2))+1)-1) | [
"misc.opposites",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 590,098 | 590,099 | u589578850 | python |
p02786 | import math
h = int(input())
print(2**math.ceil(math.log(h,2))-1) | import math
h = int(input())
print(2**(math.floor(math.log(h,2))+1)-1) | [
"call.arguments.change",
"misc.opposites",
"identifier.change",
"expression.operation.binary.change",
"io.output.change"
] | 590,100 | 590,099 | u589578850 | python |
p02786 | h = int(input())
count = 0
while h != 0:
count += 1
h = h//2
print(pow(2, count)) | h = int(input())
count = 0
while h != 0:
count += 1
h = h//2
print(pow(2, count) - 1) | [
"expression.operation.binary.add"
] | 590,101 | 590,102 | u694422786 | python |
p02786 | #!/user/bin/env python
#pythonプログラムであることを示している
# -*- coding: utf-8 -*-
"""
このプログラムはPythonを書く際のテンプレとなっています。これをコピペしてコーディングを行なってください。
なお字下げしないこと!!
"""
__author_ = 'Maruta Yuzuha'
__version_ = '1.0.0'
__date__ = '2019/12/25'
import math
def main():
"""
ここでプログラムの解説を行う
>>main()
Hello world.
0
"""
... | #!/user/bin/env python
#pythonプログラムであることを示している
# -*- coding: utf-8 -*-
"""
このプログラムはPythonを書く際のテンプレとなっています。これをコピペしてコーディングを行なってください。
なお字下げしないこと!!
"""
__author_ = 'Maruta Yuzuha'
__version_ = '1.0.0'
__date__ = '2019/12/25'
import math
def main():
"""
ここでプログラムの解説を行う
>>main()
Hello world.
0
"""
... | [
"call.remove"
] | 590,107 | 590,108 | u082748852 | python |
p02786 | H=int(input())
c =0
while c !=1:
H = H//2
c+=1
print(2**(c+1)-1) | H=int(input())
c =0
while H !=1:
H = H//2
c+=1
print(2**(c+1)-1)
| [
"identifier.change",
"control_flow.loop.condition.change"
] | 590,113 | 590,114 | u226849101 | python |
p02786 | h=int(input())
def aaa(i):
if i == 1:
return(1)
else:
return 2*aaa(i//2)+1
aaa(h) | h=int(input())
def aaa(i):
if i == 1:
return(1)
else:
return 2*aaa(i//2)+1
print(aaa(h)) | [
"call.add",
"call.arguments.change"
] | 590,115 | 590,116 | u344959886 | python |
p02786 | import sys
import math
sys.setrecursionlimit(10 ** 9)
def func(h,ans):
ans += 1
if h == 1:
return ans
if h > 1:
return 2 * func(math.floor(h/2),ans) + 1
h = int(input())
ans = 0
print(func(h,ans))
| import sys
import math
sys.setrecursionlimit(10 ** 9)
def func(h,ans):
if h == 1:
return ans+1
if h > 1:
return 2 * func(math.floor(h/2),ans) + 1
h = int(input())
ans = 0
print(func(h,ans)) | [
"expression.operation.binary.add"
] | 590,123 | 590,124 | u489762173 | python |
p02786 | h=int(input())
m=0
while 2**m<=h:
m+=1
m=m-1
print(2**m-1)
| h=int(input())
m=0
while 2**m<=h:
m+=1
print(2**m-1)
| [
"assignment.remove"
] | 590,135 | 590,136 | u223904637 | python |
p02786 | H = int(input())
cnt = 0
while 0 < H:
H //= 2
cnt += 1
print(2 * cnt - 1) | H = int(input())
cnt = 0
while 0 < H:
H //= 2
cnt += 1
print(2 ** cnt - 1)
| [
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 590,137 | 590,138 | u415905784 | python |
p02786 | h=int(input())
i=1
while h>0:
h//=2
i+=1
print((1<<i)-1)
| h=int(input())
i=0
while h>0:
h//=2
i+=1
print((1<<i)-1)
| [
"literal.number.integer.change",
"assignment.value.change"
] | 590,142 | 590,143 | u225388820 | python |
p02786 | # -*- coding:utf-8 -*-
h = int(input())
count = 1
while(h > 1):
h = (h //2)
count += 1
print(2**count) | # -*- coding:utf-8 -*-
h = int(input())
count = 1
while(h > 1):
h = (h //2)
count += 1
print(2**count -1) | [
"expression.operation.binary.add"
] | 590,146 | 590,147 | u128661070 | python |
p02786 | import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
@lru_cache(maxsize=None)
def a(n):
if n == 1:
return 1
return 1 + 2 * a(n // 2)
print(a(1000000000000))
| import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
@lru_cache(maxsize=None)
def a(n):
if n == 1:
return 1
return 1 + 2 * a(n // 2)
print(a(int(input())))
| [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"io.output.change",
"call.arguments.add"
] | 590,158 | 590,159 | u780475861 | python |
p02786 | import math
h=int(input())
x =math.ceil(math.log2(h))
print( sum([2**y for y in range(x+1)]))
| import math
h=int(input())
x =math.floor(math.log(h,2))
print( sum([2**y for y in range(x+1)])) | [
"misc.opposites",
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"call.arguments.add"
] | 590,178 | 590,177 | u696240348 | python |
p02786 | H = int(input())
s = 1
count = 0
while H > 0:
count += n
H //= 2
s *= 2
print(count)
| H = int(input())
s = 1
count = 0
while H > 0:
count += s
H //= 2
s *= 2
print(count)
| [
"identifier.change"
] | 590,185 | 590,186 | u556589653 | python |
p02786 | h = int(input())
dp = [0, 1]
for i in range(2, 100001):
x = 1 + 2 * dp[i // 2]
dp.append(x)
if h < 100001:
print(dp[h])
else:
l = []
y = h
while y >= 100001:
l = [x] + l
y = y// 2
ans = 1 + 2 * dp[l[0] // 2]
if len(l) > 1:
for i in range(len(l) - 1):
... | h = int(input())
dp = [0, 1]
for i in range(2, 100001):
x = 1 + 2 * dp[i // 2]
dp.append(x)
if h < 100001:
print(dp[h])
else:
l = []
y = h
while y >= 100001:
l = [y] + l
y = y// 2
ans = 1 + 2 * dp[l[0] // 2]
if len(l) > 1:
for i in range(len(l) - 1):
... | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 590,193 | 590,194 | u552290152 | python |
p02786 | import math
h = int(input())
def sum(list,k):#最初からk個までの和
s = 0
for i in range(len(list)-k):
s = s+ list[i]
return s
x = math.ceil(math.log2(h*1.0))
print(2**x - 1)
| import math
h = int(input())
def sum(list,k):#最初からk個までの和
s = 0
for i in range(len(list)-k):
s = s+ list[i]
return s
x = math.ceil(math.log2((h+1)*1.0))
print(2**x - 1)
| [
"call.arguments.change"
] | 590,197 | 590,198 | u855781168 | python |
p02786 | #D
import math
i = int(input())
low = 0
high = 45
for _ in range(100):
l = 2**low
h = 2**high
m = 2**((low+high)/2)
if i < m:
high = (low+high)/2
else:
low = (low+high)/2
print(low,high)
tmp = math.floor(high) + 1
print((2**tmp)-1) | #D
import math
i = int(input())
low = 0
high = 45
for _ in range(100):
l = 2**low
h = 2**high
m = 2**((low+high)/2)
if i < m:
high = (low+high)/2
else:
low = (low+high)/2
#print(low,high)
tmp = math.floor(high) + 1
print((2**tmp)-1) | [
"call.remove"
] | 590,199 | 590,200 | u386170566 | python |
p02786 | #D
import math
i = int(input())
low = 0
high = 45
for _ in range(10):
l = 2**low
h = 2**high
m = 2**((low+high)/2)
if i < m:
high = (low+high)/2
else:
low = (low+high)/2
tmp = math.floor(high) + 1
print((2**tmp)-1) | #D
import math
i = int(input())
low = 0
high = 45
for _ in range(100):
l = 2**low
h = 2**high
m = 2**((low+high)/2)
if i < m:
high = (low+high)/2
else:
low = (low+high)/2
#print(low,high)
tmp = math.floor(high) + 1
print((2**tmp)-1) | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 590,201 | 590,200 | u386170566 | python |
p02786 | import math
h=int(input())
n=math.floor(math.log2(h))
x=0
for i in range(n+1):
x+=2**i // 2^i
print(x) | import math
h=int(input())
n=math.floor(math.log2(h))
x=0
for i in range(n+1):
x+=2**i
print(x) | [
"expression.operation.binary.remove"
] | 590,203 | 590,204 | u427093056 | python |
p02786 | from bisect import bisect_right
n=int(input())
lst=[1]
lst2=[1]
for i in range(1,41):
lst.append(2**i)
lst2.append(lst2[i-1]+lst[i])
ind=bisect_right(lst,n)
print(lst2[ind]) | from bisect import bisect_right
n=int(input())
lst=[1]
lst2=[1]
for i in range(1,41):
lst.append(2**i)
lst2.append(lst2[i-1]+lst[i])
ind=bisect_right(lst,n)
print(lst2[ind-1]) | [
"expression.operation.binary.add"
] | 590,209 | 590,210 | u763380276 | python |
p02786 | from bisect import bisect_left
n=int(input())
lst=[1]
lst2=[1]
for i in range(1,41):
lst.append(2**i)
lst2.append(lst2[i-1]+lst[i])
ind=bisect_left(lst,n)
print(lst2[ind]) | from bisect import bisect_right
n=int(input())
lst=[1]
lst2=[1]
for i in range(1,41):
lst.append(2**i)
lst2.append(lst2[i-1]+lst[i])
ind=bisect_right(lst,n)
print(lst2[ind-1]) | [
"identifier.change",
"assignment.value.change",
"call.function.change"
] | 590,211 | 590,210 | u763380276 | python |
p02786 | h=int(input())
count=0
while h>1:
h = h // 2
conut += 1
print(2 ** (count+1) - 1) | h=int(input())
count=0
while h>1:
h = h // 2
count += 1
print(2 ** (count+1) - 1)
| [
"identifier.change"
] | 590,212 | 590,213 | u857070771 | python |
p02786 | h = int(input())
attack = 1
while h > 0 :
h = h // 2
print(h)
attack *= 2
print(attack - 1) | h = int(input())
attack = 1
while h > 0 :
h = h // 2
attack *= 2
print(attack - 1) | [
"call.remove"
] | 590,231 | 590,232 | u540409459 | python |
p02786 | H = int(input())
h = H
count = 0
while h > 1:
h = h // 2
count += 1
print(2**count - 1 + H) | H = int(input())
h = H
count = 0
while h > 1:
h = h // 2
count += 1
print(2**(count + 1) - 1) | [
"call.arguments.change",
"expression.operation.binary.remove"
] | 590,235 | 590,236 | u533713111 | python |
p02786 | n = int(input())
n = int(log2(n))+1
print(2**n-1) | import math
n = int(input())
n = int(math.log2(n))+1
print(2**n-1) | [] | 590,248 | 590,249 | u582632397 | python |
p02786 | h=int(input())
h1=h
icnt=1
for i in range(1000):
h1=h1//2
icnt=icnt+1
if h1<=1:
break
s=int(2**icnt)-1
print(s)
| h=int(input())
h1=h
icnt=0
for i in range(1000):
h1=h1//2
icnt=icnt+1
if h1<1:
break
s=int(2**icnt)-1
print(s) | [
"literal.number.integer.change",
"assignment.value.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 590,269 | 590,270 | u576432509 | python |
p02786 | h=int(input())
h1=h
icnt=1
for i in range(40):
h1=h1//2
icnt=icnt+1
if h1<=1:
break
s=2**icnt-1
print(s) | h=int(input())
h1=h
icnt=0
for i in range(1000):
h1=h1//2
icnt=icnt+1
if h1<1:
break
s=int(2**icnt)-1
print(s) | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"call.add"
] | 590,271 | 590,270 | u576432509 | python |
p02786 | h = int(input())
import math
if h == 1:
print(1)
else:
n_attacks = 0
while h / 2 >= 1:
n_attacks += 1
h = math.floor(h/2)
gsum = 1
for x in range(n_attacks + 1):
gsum += 2 ** (x + 1)
print(gsum) | h = int(input())
import math
if h == 1:
print(1)
else:
n_attacks = 0
while h / 2 >= 1:
n_attacks += 1
h = math.floor(h/2)
gsum = 1
for x in range(n_attacks):
gsum += 2 ** (x + 1)
print(gsum) | [
"expression.operation.binary.remove"
] | 590,272 | 590,273 | u951947571 | python |
p02786 | H = int(input())
if H==1:
print(1)
elif 2 <= H and H <= 3:
print(3)
elif 4 <= H and H <= 7:
print(7)
else:
for i in range (1,44):
if 2**(i-1)<H and H <2**(i):
print(2**(i)-1)
else:
pass
| H = int(input())
if H==1:
print(1)
elif 2 <= H and H <= 3:
print(3)
elif 4 <= H and H <= 7:
print(7)
else:
for i in range (1,43):
if 2**(i-1)<=H and H <2**(i):
print(2**(i)-1)
else:
pass | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 590,277 | 590,278 | u890183245 | python |
p02786 | H = int(input())
if H==1:
print(1)
elif 2 <= H and H <= 3:
print(3)
elif 4 <= H and H <= 7:
print(7)
else:
for i in range (1,43):
if 2**(i-1)<H and H <2**(i):
print(2**(i)-1)
else:
pass | H = int(input())
if H==1:
print(1)
elif 2 <= H and H <= 3:
print(3)
elif 4 <= H and H <= 7:
print(7)
else:
for i in range (1,43):
if 2**(i-1)<=H and H <2**(i):
print(2**(i)-1)
else:
pass | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 590,279 | 590,278 | u890183245 | python |
p02786 | H=int(input())
A=1
if H==1:
print(1)
else:
while H>=A:
A*=2 | H=int(input())
A=1
if H==1:
print(1)
else:
while H>=A:
A*=2
print(A-1)
| [
"call.add"
] | 590,282 | 590,283 | u065774356 | python |
p02786 | # cook your dish here
from math import log2
n=int(input())
k=round(log2(n))
if int(k)==k:
print(pow(2,k+1)-1)
else:
print(pow(2,k)-1) | # cook your dish here
from math import log2,floor
n=int(input())
k=floor(log2(n))
if int(k)==k:
print(pow(2,k+1)-1)
else:
print(pow(2,k)-1) | [
"assignment.value.change",
"identifier.change",
"call.function.near.change"
] | 590,293 | 590,294 | u092460072 | python |
p02786 | h = int(input())
ch=1
total=1
while 1:
if h <= ch:
break
else:
ch*=2
total+=1
print(ch*2-1) | h = int(input())
ch=1
total=1
while 1:
if h < ch:
break
else:
ch*=2
total+=1
print(ch-1) | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 590,300 | 590,301 | u522293645 | python |
p02786 | #!/usr/bin/env python3
import sys
def solve(H: int):
ans = 2 ** f(H) - 1
print(ans if ans > 0 else 1)
return
def f(H, dep=1):
half_h = H // 2
dep += 1
return f(half_h, dep) if half_h > 1 else dep
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the defaul... | #!/usr/bin/env python3
import sys
def solve(H: int):
ans = 2 ** f(H) - 1
print(ans if H > 1 else 1)
return
def f(H, dep=1):
half_h = H // 2
dep += 1
return f(half_h, dep) if half_h > 1 else dep
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default ... | [
"identifier.change",
"call.arguments.change",
"io.output.change",
"literal.number.integer.change"
] | 590,302 | 590,303 | u928254435 | python |
p02786 | H = int(input())
count = 0
def helper(x):
if x == 1:
return 1
return helper(x/2) * 2 + 1
print(helper(H)) | H = int(input())
count = 0
def helper(x):
if x == 1:
return 1
return helper(x//2) * 2 + 1
print(helper(H)) | [
"expression.operator.arithmetic.change",
"call.arguments.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 590,306 | 590,307 | u851648783 | python |
p02786 | # D
def touhi(a,r,n):
return a*(pow(r, n) - 1)//(r-1)
H = int(input())
n = math.floor(math.log2(H))+1
print(touhi(a=1, r=2, n=n)) | import math
def touhi(a,r,n):
return a*(pow(r, n) - 1)//(r-1)
H = int(input())
n = math.floor(math.log2(H))+1
print(touhi(a=1, r=2, n=n)) | [] | 590,308 | 590,309 | u239528020 | python |
p02786 | i=int(input())
nest=1
a=0
p=i
if p==1:
print(1)
for k in range(50):
nest+=1
p=p//2
if p==1:
break
a=(2**nest)-1
print(a)
| i=int(input())
nest=1
a=0
p=i
if p==1:
print(1)
else:
for k in range(50):
nest+=1
p=p//2
if p==1:
break
a=(2**nest)-1
print(a)
| [] | 590,323 | 590,324 | u291988695 | python |
p02786 | h = int(input())
m =1
cnt=0
if h <1:
print(1)
elif h <=3:
print(3)
else:
while h >3:
h = h //2
cnt+=m
m = m*2
cnt=cnt+m*3
print(cnt)
| h = int(input())
m =1
cnt=0
if h <=1:
print(1)
elif h <=3:
print(3)
else:
while h >3:
h = h //2
cnt+=m
m = m*2
cnt=cnt+m*3
print(cnt)
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 590,327 | 590,328 | u062189367 | python |
p02786 | a=int(input())
n = str(bin (a))
print(n,2**(len(n)-2)-1) | a=int(input())
n = str(bin (a))
print(2**(len(n)-2)-1)
| [
"call.arguments.change"
] | 590,339 | 590,340 | u487594898 | python |
p02786 | h = int(input())
n = 0
l = []
for i in range(42):
l.append(2**i)
for i in range(1,41):
if l[i]<=h<l[i+1]:
ans=sum(l[:i+1])
print(ans) | h = int(input())
n = 0
l = []
ans = 1
for i in range(42):
l.append(2**i)
for i in range(1,41):
if l[i]<=h<l[i+1]:
ans=sum(l[:i+1])
print(ans) | [
"assignment.add"
] | 590,341 | 590,342 | u007263493 | python |
p02786 | h=int(input())
n=len(list(bin(h)))-1
print(2**n-1) | h=int(input())
n=len(list(bin(h)))-2
print(2**n-1) | [
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 590,343 | 590,344 | u747220349 | python |
p02786 | H = int(input())
# nが0になるまで何回割れるか
def divCount(n, cnt = 0):
if n <= 1:
return cnt
return divCount(n / 2, cnt + 1)
attackCount = 0
for i in range(0, divCount(H)+1):
attackCount += pow(2, i)
print(attackCount) | H = int(input())
# nが0になるまで何回割れるか
def divCount(n, cnt = 0):
if n <= 1:
return cnt
return divCount(int(n / 2), cnt + 1)
attackCount = 0
for i in range(0, divCount(H)+1):
attackCount += pow(2, i)
print(attackCount) | [
"call.arguments.add",
"call.arguments.change",
"function.return_value.change"
] | 590,355 | 590,356 | u068210419 | python |
p02786 | h = int(input())
count = 0
n = 1
while (h > 1):
h = int(h / 2)
count += 1
n += 2 ** count
print(n)
print(h)
| h = int(input())
count = 0
n = 1
while (h > 1):
h = int(h / 2)
count += 1
n += 2 ** count
print(n)
| [
"call.remove"
] | 590,359 | 590,360 | u530786533 | python |
p02786 | from math import log2,ceil
h = int(input())
print(2**ceil(log2(h))-1) | from math import log2,floor
h = int(input())
print(2**(floor(log2(h))+1)-1) | [
"misc.opposites",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"call.add"
] | 590,363 | 590,364 | u095094246 | python |
p02786 | import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect... | import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect... | [
"misc.opposites",
"assignment.value.change",
"identifier.change",
"call.function.change"
] | 590,375 | 590,376 | u404290207 | python |
p02786 | import math
H = int(input())
count = 1
while True:
if H == 1:
break
H = math.ceil(H/2)
count += 1
print(2**count-1)
| import math
H = int(input())
count = 1
while True:
if H == 1:
break
H = math.floor(H/2)
count += 1
print(2**count-1)
| [
"misc.opposites",
"assignment.value.change",
"identifier.change"
] | 590,387 | 590,388 | u357949405 | python |
p02786 | N=int(input())
def sep_to_1(n):
sep_mon=n
count=0
mons_num=1
sum_sep_count=0
while sep_mon!=1:
count+=1
# print("stage",count)
sep_mon=sep_mon//2
sum_sep_count+=mons_num
mons_num=2*mons_num
# print("sep_mon",sep_mon)
# print("mons_num... | N=int(input())
def sep_to_1(n):
sep_mon=n
count=0
mons_num=1
sum_sep_count=0
while sep_mon!=1:
count+=1
# print("stage",count)
sep_mon=sep_mon//2
sum_sep_count+=mons_num
mons_num=2*mons_num
# print("sep_mon",sep_mon)
# print("mons_num... | [
"expression.operation.binary.remove"
] | 590,389 | 590,390 | u417014669 | python |
p02786 | h = int(input())
double = 0
for i in range(h, 1, -1):
if h == 1:
break
h = h // 2
double += 1
print(double + 1)
total = 0
for i in range(double + 1):
total += pow(2, i)
print(total) | h = int(input())
double = 0
for i in range(h, 1, -1):
if h == 1:
break
h = h // 2
double += 1
total = 0
for i in range(double + 1):
total += pow(2, i)
print(total) | [
"call.remove"
] | 590,391 | 590,392 | u762275701 | python |
p02786 | H = int(input())
cnt = 0
n = math.floor(math.log2(H))
ans = 0
for i in range(n+1):
cnt += int(math.pow(2,i))
print(cnt) | import math
H = int(input())
cnt = 0
n = math.floor(math.log2(H))
ans = 0
for i in range(n+1):
cnt += int(math.pow(2,i))
print(cnt) | [] | 590,393 | 590,394 | u909375661 | python |
p02786 | h = input()
h = int(h)
count = 0
attack = 0
if h > 1:
while h > 1:
h = h / 2
count = count + 1
for i in range(0, count):
attack = attack + (2**i)
print(attack)
else:
print(1)
| h = input()
h = int(h)
count = 0
attack = 0
if h > 1:
while h >= 1:
h = h / 2
count = count + 1
for i in range(0, count):
attack = attack + (2**i)
print(attack)
else:
print(1)
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 590,395 | 590,396 | u994527877 | python |
p02786 | h = int(input())
res = 0
i = 1
while h > 0:
h = h//2
res = res + i
i*2
print(res) | h = int(input())
res = 0
i = 1
while h > 0:
h = h//2
res = res + i
i *= 2
print(res)
| [
"assignment.compound.arithmetic.replace.add",
"expression.operator.arithmetic.replace.remove",
"expression.operation.binary.change"
] | 590,397 | 590,398 | u005318559 | python |
p02786 | n = input()
n = int(n)
count = 0
attack = 0
if n > 1:
while n > 1:
n = n / 2
count = count + 1
for i in range(0, count):
attack = attack + (2**i)
print(attack)
else:
print("1")
| n = input()
n = int(n)
count = 0
attack = 0
if n > 1:
while n >= 1:
n = n / 2
count = count + 1
for i in range(0, count):
attack = attack + (2**i)
print(attack)
else:
print("1") | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 590,399 | 590,400 | u139282395 | python |
p02786 | def a(H):
global ans
global dic
if H // 2 in dic:
add = 2 * ans + 1
ans = add
dic[H] = add
else:
a(H//2)
a(H//2)
H = int(input())
dic = {}
dic[1] = 1
ans = 1
a(H)
print(ans) | def a(H):
global ans
global dic
if H // 2 in dic:
add = 2 * ans + 1
ans = add
dic[H] = add
else:
a(H//2)
a(H//2)
H = int(input())
dic = {}
dic[1] = 1
ans = 1
if H != 1:
a(H)
print(ans) | [
"control_flow.branch.if.add"
] | 590,409 | 590,410 | u151531137 | python |
p02786 |
def a(H):
global ans
global dic
if H // 2 in dic:
add = 2 * ans + 1
ans = add
dic[H] = add
else:
a(H//2)
a(H//2)
H = int(input())
dic = {}
dic[1] = 1
ans = 1
a(H)
print(ans)
| def a(H):
global ans
global dic
if H // 2 in dic:
add = 2 * ans + 1
ans = add
dic[H] = add
else:
a(H//2)
a(H//2)
H = int(input())
dic = {}
dic[1] = 1
ans = 1
if H != 1:
a(H)
print(ans) | [
"control_flow.branch.if.add"
] | 590,411 | 590,410 | u151531137 | python |
p02786 |
import math
h = int(input())
i = 0
c = 0
while h != 0:
c += 2**i
if h > 1:
h = math.ceil(h/2)
else:
h = 0
i += 1
print(c) | import math
h = int(input())
i = 0
c = 0
while h != 0:
c += 2**i
if h > 1:
h = math.floor(h/2)
else:
h = 0
i += 1
print(c) | [
"misc.opposites",
"assignment.value.change",
"identifier.change"
] | 590,412 | 590,413 | u620755587 | python |
p02786 | from functools import lru_cache
h = int(input())
count = 0
while n==1:
n = h//2
count +=1
@lru_cache(maxsize=100000)
def f(n):
if n < 1:
return 3
else:
return f(n - 1)*2 + 1
print(f(count)) | from functools import lru_cache
h = int(input())
count = 0
while h > 1:
h = h//2
count +=1
@lru_cache(maxsize=100000)
def f(n):
if n < 1:
return 1
else:
return f(n - 1)*2 + 1
print(f(count)) | [
"assignment.variable.change",
"identifier.change",
"literal.number.integer.change",
"function.return_value.change"
] | 590,438 | 590,439 | u699089116 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.