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 9
values |
|---|---|---|---|---|---|---|---|
p02786 | h=int(input())
def f(n):
if n==1:
return 1
else:
return 2 * f(n) + 1
hit=f(h)
print(hit) | h=int(input())
def f(n):
if n==1:
return 1
else:
return 2 * f(n//2) + 1
hit=f(h)
print(hit) | [
"expression.operation.binary.add"
] | 589,609 | 589,610 | u131638468 | python |
p02786 | #D
H = int(input())
c = 1
while H>1:
H = math.floor(H/2)
c += 1
print(sum([2**i for i in range(c)])) | #D
import math
H = int(input())
c = 1
while H>1:
H = math.floor(H/2)
c += 1
print(sum([2**i for i in range(c)])) | [] | 589,625 | 589,626 | u081340269 | python |
p02786 | import math
H = int(input())
p = math.ceil(math.log2(H))
print(2**p - 1) | import math
H = int(input())
p = math.floor(math.log2(H) + 1)
print(2**p - 1) | [
"misc.opposites",
"assignment.value.change",
"identifier.change"
] | 589,632 | 589,633 | u692453235 | python |
p02786 | def f(H):
if H==1:
return 1
elif H>1:
return 2*(H//2) +1
h=int(input())
print(f(h)) | def f(H):
if H==1:
return 1
elif H>1:
return 2*f(H//2) +1
h=int(input())
print(f(h)) | [
"call.add",
"function.return_value.change"
] | 589,634 | 589,635 | u337626942 | python |
p02786 | def atk(H):
if H == 1:
return(H)
else:
global count
count += 1
return(atk(H//2))
count = 0
atk(int(input()))
print(-1*(1-(2**(count)))) | def atk(H):
if H == 1:
return(H)
else:
global count
count += 1
return(atk(H//2))
count = 0
atk(int(input()))
print(-1*(1-(2**(count+1)))) | [
"expression.operation.binary.add"
] | 589,640 | 589,641 | u297046168 | python |
p02786 | def attack(num, cnt):
cnt+=1
if num==1:
return cnt
else:
return attack(num//2, cnt)
H = int(input())
cnt=0
cnt = attack(H, cnt)
tmp = [2**x for x in range(cnt)]
sum(tmp) | def attack(num, cnt):
cnt+=1
if num==1:
return cnt
else:
return attack(num//2, cnt)
H = int(input())
cnt=0
cnt = attack(H, cnt)
tmp = [2**x for x in range(cnt)]
print(sum(tmp)) | [
"call.add",
"call.arguments.change"
] | 589,649 | 589,650 | u461833298 | python |
p02786 | def a(x):
if x == 1: return 1
if x > 1: return a((x + 1) // 2) * 2 + 1
print(a(int(input()))) | def a(x):
if x == 1: return 1
if x > 1: return a(x // 2) * 2 + 1
print(a(int(input())))
| [
"call.arguments.change"
] | 589,665 | 589,664 | u067694718 | python |
p02786 | def a(x):
if x == 1: return 1
if x > 1: return a(x/2) * 2 + 1
print(a(int(input())))
| def a(x):
if x == 1: return 1
if x > 1: return a(x // 2) * 2 + 1
print(a(int(input())))
| [
"expression.operator.arithmetic.change",
"call.arguments.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 589,667 | 589,664 | u067694718 | python |
p02786 | n =int(input())
ans = 1
for i in range(int(np.log2(n))):
ans += 2**(i+1)
print(ans) | import numpy as np
n =int(input())
ans = 1
for i in range(int(np.log2(n))):
ans += 2**(i+1)
print(ans) | [] | 589,668 | 589,669 | u549383771 | python |
p02786 | def attack(x):
if x==1:
return 1
else:
return (attack(-(-x/2))*2+1)
h=int(input())
print(attack(h)) | def attack(x):
if x==1:
return 1
else:
return (attack(x//2)*2+1)
h=int(input())
print(attack(h)) | [
"expression.operator.arithmetic.change",
"call.arguments.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 589,672 | 589,673 | u758831502 | python |
p02786 | N=int(input())
a=0
d=1
while d<=N:
a+=d
d*=2
print(ans) | N=int(input())
a=0
d=1
while d<=N:
a+=d
d*=2
print(a)
| [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 589,674 | 589,675 | u918601425 | python |
p02786 | N = input()
cnt = 0
while N>1:
N = int(N/2)
cnt +=1
print(2**(cnt+1)-1) | N = int(input())
cnt = 0
while N>1:
N = int(N/2)
cnt +=1
print(2**(cnt+1)-1) | [
"call.add",
"call.arguments.change"
] | 589,679 | 589,680 | u904081717 | python |
p02786 | h = int(input())
dep = 0
def log_num(n):
global dep
if n == 1:
return dep
else:
dep += 1
log_num(n//2)
log_num(h)
ans = 1
for i in range(dep+1):
ans *= 2
print(ans)
| h = int(input())
dep = 0
def log_num(n):
global dep
if n == 1:
return dep
else:
dep += 1
log_num(n//2)
log_num(h)
ans = 1
for i in range(dep+1):
ans *= 2
print(ans-1)
| [
"expression.operation.binary.add"
] | 589,685 | 589,686 | u933129390 | python |
p02786 | import math
h=int(input())
m=math.ceil(math.log2(h))
print(2**m-1) | import math
h=int(input())
m=math.floor(math.log2(h))
print(2**(m+1)-1) | [
"misc.opposites",
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 589,697 | 589,698 | u547167033 | python |
p02786 | import math
h=int(input())
m=int(math.long(h,2))
print(2**(h+1)-1)
| import math
h=int(input())
m=int(math.log(h,2))
print(int(2**(m+1)-1))
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"call.add",
"expression.operation.binary.change",
"io.output.change"
] | 589,701 | 589,700 | u547167033 | python |
p02786 | h = int(input())
ans, i = 0, 1
while h >= i:
ans += 1
i *= 2
print(ans) | h = int(input())
ans, i = 0, 1
while h >= i:
ans += i
i *= 2
print(ans) | [
"identifier.replace.add",
"literal.replace.remove"
] | 589,706 | 589,707 | u392058721 | python |
p02786 | import math
n = int(input())
kaisu = math.log2(n)
ans = 0
for i in range(int(kaisu)):
ans += 2 ** i
print(ans)
| import math
n = int(input())
kaisu = math.log2(n) + 1
ans = 0
for i in range(int(kaisu)):
ans += 2 ** i
print(ans)
| [
"assignment.change"
] | 589,710 | 589,711 | u860966226 | python |
p02786 | import math
n = int(input())
kaisu = math.log2(n)
ans = 0
for i in range(kaisu):
ans += 2 ** i
print(ans)
| import math
n = int(input())
kaisu = math.log2(n) + 1
ans = 0
for i in range(int(kaisu)):
ans += 2 ** i
print(ans)
| [
"call.add",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 589,712 | 589,711 | u860966226 | python |
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.