Datasets:

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()) ans = 0 print(H) while H > 1: if H%2 == 0: H = H/2 ans += 1 else: H = (H-1)/2 ans += 1 N = 2**ans def fight(k): if k == 1: return 1 else: return 2*fight(k/2)+1 print(fight(N))
H=int(input()) ans = 0 while H > 1: if H%2 == 0: H = H/2 ans += 1 else: H = (H-1)/2 ans += 1 N = 2**ans def fight(k): if k == 1: return 1 else: return 2*fight(k/2)+1 print(fight(N))
[ "call.remove" ]
590,452
590,453
u829008868
python
p02786
h = int(input().split()) print(2 ** (len(bin(h)) - 2) - 1)
h = int(input()) print(2 ** (len(bin(h)) - 2) - 1)
[ "call.remove" ]
590,454
590,455
u686230543
python
p02786
h = int(input()) c = 0 while h >= 2: h /= 2 c += 1 count = 1 for i in range(1,c+1): count = count + 2*i print(count)
h = int(input()) c = 0 while h >= 2: h /= 2 c += 1 count = 1 for i in range(1,c+1): count = count + 2**i print(count)
[ "assignment.value.change", "expression.operation.binary.change" ]
590,463
590,464
u969211566
python
p02786
H = int(input()) ans = 0 n = 1 def calc(h,n): a = h//2 if a==1: n += 2 else: n += 2*calc(a,n) return n if H == 1: print(1) else: ans = calc(H,n) print(ans)
H = int(input()) n = 1 def calc(h,n): a = h//2 if a==1: n += 2 else: n += 2*calc(a,n) return n if H == 1: print(1) else: ans = calc(H,n) print(ans)
[ "assignment.remove" ]
590,465
590,466
u434872492
python
p02786
from sys import stdin import math n = int(stdin.readline().rstrip()) i = 0 while True: if 2**i >= n: break i += 1 point = 0 for j in range(i): point += 2**j print(point)
from sys import stdin import math n = int(stdin.readline().rstrip()) i = 0 while True: if 2**i > n: break i += 1 point = 0 for j in range(i): point += 2**j print(point)
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
590,478
590,479
u987164499
python
p02786
h = int(input()) lhb = len(format(h, "b")) print(2 ** lhb - 1 + lhb)
h = int(input()) lhb = len(format(h, "b")) print(2 ** lhb - 1)
[ "expression.operation.binary.remove" ]
590,486
590,487
u081193942
python
p02786
h = int(input()) lhb = len(format(h, "b")) print(2 * lhb - 1)
h = int(input()) lhb = len(format(h, "b")) print(2 ** lhb - 1)
[ "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
590,488
590,487
u081193942
python
p02786
h = int(input()) n = 0 while 2**n < h: n += 1 print(2**n-1)
h = int(input()) n = 0 while 2**n <= h: n += 1 print(2**n-1)
[ "expression.operator.compare.change", "control_flow.loop.condition.change" ]
590,493
590,494
u825769322
python
p02786
n=int(input()) for i in range(50): if n<2**i: break print(i) out=0 for k in range(i): out+=2**k print(out)
n=int(input()) for i in range(50): if n<2**i: break #print(i) out=0 for k in range(i): out+=2**k print(out)
[ "call.remove" ]
590,501
590,502
u916637712
python
p02786
h = input() cnt = 0 while h > 0: h = h // 2 cnt = cnt + 1 print(pow(2, cnt) - 1)
h = int(input()) cnt = 0 while h > 0: h = h // 2 cnt = cnt + 1 print(int(pow(2, cnt) - 1))
[ "call.add", "call.arguments.change" ]
590,505
590,506
u387147192
python
p02787
H, N = map(int,input().split()) M = [] for k in range(N): M.append(list(map(int,input().split()))) dp = [10**9]*(H+1) dp[0] = 0 for A, B in M: for k in range(A+1): dp[k] = min(dp[k],B) for k in range(A+1,H+1): dp[k] = min(dp[k],dp[k-A]+B) print(dp[H])
H, N = map(int,input().split()) M = [] for k in range(N): M.append(list(map(int,input().split()))) dp = [10**9]*(10**5) dp[0] = 0 for A, B in M: for k in range(A+1): dp[k] = min(dp[k],B) for k in range(A+1,H+1): dp[k] = min(dp[k],dp[k-A]+B) print(dp[H])
[]
590,545
590,546
u620084012
python
p02787
import sys input = sys.stdin.readline() H,N = map(int,input().split()) spells = [list(map(int,input().split())) for i in range(N)] INF = 10**10 dp = [INF]*(H+1) dp[0] = 0 for use in spells: damage = use[0] mp = use[1] for i in range(1,H+1): dp[i] = min(dp[max(0,i-damage)] + mp, dp[i]) print(dp[-1])
import sys input = sys.stdin.readline H,N = map(int,input().split()) spells = [list(map(int,input().split())) for i in range(N)] INF = 10**10 dp = [INF]*(H+1) dp[0] = 0 for use in spells: damage = use[0] mp = use[1] for i in range(1,H+1): dp[i] = min(dp[max(0,i-damage)] + mp, dp[i]) print(dp[-1])
[ "call.arguments.change" ]
590,598
590,599
u623687794
python
p02787
h,n=map(int,input().split()) a,b=[],[] for i in range(n): aa,bb=map(int,input().split()) a.append(aa) b.append(bb) inf=float("inf") dp=[[inf]*(h+1) for i in range(n+1)] dp[0][0]=0 for i in range(n): for j in range(h): dp[i+1][j]=min(dp[i+1][j],dp[i][j]) dp[i+1][min(h,j+a[i])]=min(dp[i+1][j]+b[i],dp[i+1]...
h,n=map(int,input().split()) a,b=[],[] for i in range(n): aa,bb=map(int,input().split()) a.append(aa) b.append(bb) inf=float("inf") dp=[[inf]*(h+1) for i in range(n+1)] dp[0][0]=0 for i in range(n): for j in range(h+1): dp[i+1][j]=min(dp[i+1][j],dp[i][j]) dp[i+1][min(h,j+a[i])]=min(dp[i+1][j]+b[i],dp[i+...
[ "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.add" ]
590,603
590,604
u970197315
python
p02787
import sys def main(): input = sys.stdin.buffer.readline h, n = map(int, input().split()) a = [0] * n b = [0] * n for i in range(n): a[i], b[i] = map(int, input().split()) max_a = max(a) # dp[j]:jダメージ与える魔力の最小値 dp = [1e9] * (h + max_a + 1) dp[0] = 0 for i in range(n): ...
import sys def main(): input = sys.stdin.buffer.readline h, n = map(int, input().split()) a = [0] * n b = [0] * n for i in range(n): a[i], b[i] = map(int, input().split()) max_a = max(a) # dp[j]:jダメージ与える魔力の最小値 dp = [1e9] * (h + max_a + 1) dp[0] = 0 for i in range(n): ...
[ "call.remove", "call.arguments.change" ]
590,637
590,638
u331327289
python
p02787
def chmin(dp, i, *x): dp[i] = min(dp[i], *x) INF = float("inf") # dp[i] := min 消耗する魔力 to H -= i h, n = map(int, input().split()) dp = [INF]*-~h for _ in [None]*n: a, b = map(int, input().split()) for j in range(h + 1): chmin(dp, min(j + a, h), dp[j] + b) print(dp[h])
def chmin(dp, i, *x): dp[i] = min(dp[i], *x) INF = float("inf") # dp[i] := min 消耗する魔力 to H -= i h, n = map(int, input().split()) dp = [0] + [INF]*h for _ in [None]*n: a, b = map(int, input().split()) for j in range(h + 1): chmin(dp, min(j + a, h), dp[j] + b) print(dp[h])
[ "assignment.change" ]
590,668
590,669
u373047809
python
p02787
H,N = map(int,input().split()) magic = [list(map(int,input().split())) for i in range(N)] INF = 10**10 #print(magic) dp = [INF for i in range(H+AM+1)] dp[0] = 0 for i in range(1,H+1): for j in range(N): if magic[j][0] > i: dp[i] = min(dp[i],magic[j][1]) else: dp[i] = min(d...
H,N = map(int,input().split()) magic = [list(map(int,input().split())) for i in range(N)] INF = 10**10 dp = [INF for i in range(H+1)] dp[0] = 0 for i in range(1,H+1): for j in range(N): if magic[j][0] > i: dp[i] = min(dp[i],magic[j][1]) else: dp[i] = min(dp[i-magic[j][0]]+...
[ "expression.operation.binary.remove" ]
590,692
590,693
u747602774
python
p02787
H,N = map(int,input().split()) magic = [list(map(int,input().split())) for i in range(N)] INF = 10**10 #print(magic) dp = [INF for i in range(H+AM+1)] dp[0] = 0 for i in range(1,H+1): for j in range(N): if magic[j][0] > i: dp[i] = min(dp[i],magic[j][1]) else: dp[i] = min(d...
H,N = map(int,input().split()) magic = [list(map(int,input().split())) for i in range(N)] INF = 10**10 #print(magic) dp = [INF for i in range(H+1)] dp[0] = 0 for i in range(1,H+1): for j in range(N): if magic[j][0] > i: dp[i] = min(dp[i],magic[j][1]) else: dp[i] = min(dp[i...
[ "expression.operation.binary.remove" ]
590,692
590,694
u747602774
python
p02787
H, N = map(int, input().split()) inf = float('inf') dp = [inf] * (H + 1) dp[0] = 0 for i in range(N): A, B = map(int, input().split()) for j in range(H): t1 = j + A if t1 > H: t1 = H t2 = dp[t1] if t2 == inf: continue t2 += B if t2 < dp[t1...
H, N = map(int, input().split()) inf = float('inf') dp = [inf] * (H + 1) dp[0] = 0 for _ in range(N): A, B = map(int, input().split()) for i in range(H): t1 = i + A if t1 > H: t1 = H t2 = dp[i] if t2 == inf: continue t2 += B if t2 < dp[t1]...
[ "identifier.change", "assignment.value.change", "expression.operation.binary.change", "variable_access.subscript.index.change" ]
590,734
590,735
u347640436
python
p02787
#個数が無制限のナップザックの問題(ただし、上限に注意)です(どの魔法を順番に選べば良いなどの制約がないのでナップザックDPを選択しました。)。 #dpの配列にはi番目の要素にモンスターの体力をi減らすために必要な最小の魔力を保存します。 #この配列は個数制限がないことに注意してinfではない要素のみを順に更新していけば良いです。 #また、最終的にモンスターの体力を最小の魔力で0以下にすれば良いので、モンスターの体力をh以上減らせる最小の魔力を求めれば良いです。 h,n=map(int,input().split()) a,b=[],[] for i in range(n): a_sub,b_sub=map(int,inp...
#個数が無制限のナップザックの問題(ただし、上限に注意)です(どの魔法を順番に選べば良いなどの制約がないのでナップザックDPを選択しました。)。 #dpの配列にはi番目の要素にモンスターの体力をi減らすために必要な最小の魔力を保存します。 #この配列は個数制限がないことに注意してinfではない要素のみを順に更新していけば良いです。 #また、最終的にモンスターの体力を最小の魔力で0以下にすれば良いので、モンスターの体力をh以上減らせる最小の魔力を求めれば良いです。 h,n=map(int,input().split()) a,b=[],[] for i in range(n): a_sub,b_sub=map(int,inp...
[ "assignment.change" ]
590,757
590,758
u753386263
python
p02787
import sys input = sys.stdin.readline H, N = map(int, input().split()) dp = [float("inf")] * (H + 1) dp[H] = 0 for _ in range(N): a, b = map(int, input().split()) for x in range(H + 1): dp[max(0, x - a)] = min(dp[max(0, x - a)], dp[x] + b) print(dp[0])
import sys input = sys.stdin.readline H, N = map(int, input().split()) dp = [float("inf")] * (H + 1) dp[H] = 0 for _ in range(N): a, b = map(int, input().split()) for x in range(H, -1, -1): dp[max(0, x - a)] = min(dp[max(0, x - a)], dp[x] + b) print(dp[0])
[ "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change", "call.arguments.add" ]
590,840
590,841
u141610915
python
p02787
H,N =map(int, input().split()) a = [] M = 0 for i in range(N): t = list(map(int, input().split())) a.append(t) M = max(M,t[0]) dp = [10000]*(H+1+M) dp[0] = 0 for i in range(H): for j,k in a: dp[i+j] = min(dp[i+j],dp[i]+k) print(min(dp[H:]))
H,N =map(int, input().split()) a = [] M = 0 for i in range(N): t = list(map(int, input().split())) a.append(t) M = max(M,t[0]) dp = [100000000]*(H+1+M) dp[0] = 0 for i in range(H): for j,k in a: dp[i+j] = min(dp[i+j],dp[i]+k) print(min(dp[H:]))
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
590,866
590,867
u785578220
python
p02787
f=lambda:map(int,input().split()) h,n=f() dp=[0]+[10**9]*h for i in range(n): a,b=f() for j in range(h+1): dp[j]=min(dp[j],dp[j-a]+b) print(dp[h])
f=lambda:map(int,input().split()) h,n=f() dp=[0]+[10**9]*h for i in range(n): a,b=f() for j in range(h+1): dp[j]=min(dp[j],dp[max(j-a,0)]+b) print(dp[h])
[ "call.add", "call.arguments.add" ]
590,868
590,869
u133936772
python
p02787
h, n = map(int, input().split()) AB = [tuple(map(int, input().split())) for i in range(n)] A = [a for a, b in AB] B = [b for a, b in AB] inf = 10**10 # DP[i][j]=i個以内で体力j以上削るための消費魔力の最小値 DP = [[inf for j in range(h+1)] for i in range(n+1)] DP[0][0] = 0 for i in range(n): for j in range(h+1): DP[i+1][j] = min(...
h, n = map(int, input().split()) AB = [tuple(map(int, input().split())) for i in range(n)] A = [a for a, b in AB] B = [b for a, b in AB] inf = 10**10 # DP[i][j]=i個以内で体力j以上削るための消費魔力の最小値 DP = [[inf for j in range(h+1)] for i in range(n+1)] DP[0][0] = 0 for i in range(n): for j in range(h+1): DP[i+1][j] = min(...
[ "assignment.change" ]
590,902
590,903
u997641430
python
p02787
H,N=map(int,input().split()) A=[] B=[] for _ in range(N): a,b=map(int,input().split()) A.append(a) B.append(b) inf=float('inf') component=[0] for i in range(H): component.append(inf) DP=[] for j in range(N+1): DP.append(copy.copy(component))#DPは(N+1)×(H+1) for k in range(1,N+1):#k番目の魔法 for l...
H,N=map(int,input().split()) A=[] B=[] for _ in range(N): a,b=map(int,input().split()) A.append(a) B.append(b) inf=float('inf') component=[0] for i in range(H): component.append(inf) DP=[] for j in range(N+1): DP.append(component)#DPは(N+1)×(H+1) for k in range(1,N+1):#k番目の魔法 for l in range(1...
[ "call.remove", "call.arguments.change" ]
590,928
590,929
u523545435
python
p02787
H,N=map(int,input().split()) C=[0 for i in range(H+(10**4)+1)] d=0 for i in [0]*N: A,B=map(int,input().split()) for i in range(H+A+1): if A==i : C[i]=B elif A<i : if C[i]==0 and C[i-A]>0: C[i]=C[i-A]+B elif C[i-A]>0: C[i]=min(C[i],C[i-A]+B) d=max(d,A) e=10**9 for i in range(H+1,H+d+1): if C[i]>...
H,N=map(int,input().split()) C=[0 for i in range(H+(10**4)+1)] d=0 for i in [0]*N: A,B=map(int,input().split()) for i in range(H+A+1): if A==i : C[i]=B elif A<i : if C[i]==0 and C[i-A]>0: C[i]=C[i-A]+B elif C[i-A]>0: C[i]=min(C[i],C[i-A]+B) d=max(d,A) e=10**9 for i in range(H,H+d+1): if C[i]>0:...
[ "expression.operation.binary.remove" ]
590,939
590,940
u387774811
python
p02787
h,n=map(int,input().split()) dp=[10**10]*(h+1) dp[0]=1 X=[] for i in range(n): a,b=map(int,input().split()) X.append([a,b]) for i in range(h): for j in range(n): k=min(i+X[j][0],h) dp[k]=min(dp[k],dp[i]+X[j][1]) print(dp[h])
h,n=map(int,input().split()) dp=[10**10]*(h+1) dp[0]=0 X=[] for i in range(n): a,b=map(int,input().split()) X.append([a,b]) for i in range(h): for j in range(n): k=min(i+X[j][0],h) dp[k]=min(dp[k],dp[i]+X[j][1]) print(dp[h])
[ "literal.number.integer.change", "assignment.value.change" ]
590,974
590,975
u210827208
python
p02787
h,n=map(int,input().split()) dp=[10**10]*(h+1) dp[0][0]=1 X=[] for i in range(n): a,b=map(int,input().split()) X.append([a,b]) for i in range(h): for j in range(n): k=min(i+X[j][0],h) dp[k]=min(dp[k],dp[i]+X[j][1]) print(dp[h])
h,n=map(int,input().split()) dp=[10**10]*(h+1) dp[0]=0 X=[] for i in range(n): a,b=map(int,input().split()) X.append([a,b]) for i in range(h): for j in range(n): k=min(i+X[j][0],h) dp[k]=min(dp[k],dp[i]+X[j][1]) print(dp[h])
[ "assignment.remove" ]
590,976
590,975
u210827208
python
p02787
h,n=map(int,input().split()) H=[] A=[] for i in range(n): a,b=map(int,input().split()) H.append([a,b]) A.append(a) a_max=max(A) dp=[10**5]*(h+a_max+1) dp[0]=0 for i in range(1,h+a_max+1): for j in range(n): if i-H[j][0]<0: dp[i]=min(dp[i],H[j][1]) else: dp[i]=min(...
h,n=map(int,input().split()) H=[] A=[] for i in range(n): a,b=map(int,input().split()) H.append([a,b]) A.append(a) a_max=max(A) dp=[10**10]*(h+a_max+1) dp[0]=0 for i in range(1,h+a_max+1): for j in range(n): if i-H[j][0]<0: dp[i]=min(dp[i],H[j][1]) else: dp[i]=min...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
590,977
590,978
u210827208
python
p02787
H,N = map(int,input().split()) l = [] for i in range(N): l.append( list(map(int,input().split())) ) #dp[i][h]:i番目の魔法まで見てhのダメージを与えるときの最小魔力 dp = [[10**4+1 for j in range(H+1)] for i in range(N+1)] dp[0][0] = 0 #配るdpで考える for i in range(N): for h in range(H+1): #i番目の魔法を使わないとき dp[i+1][h] = min(dp[i][h], dp[i+...
H,N = map(int,input().split()) l = [] for i in range(N): l.append( list(map(int,input().split())) ) #dp[i][h]:i番目の魔法まで見てhのダメージを与えるときの最小魔力 dp = [[10**8+1 for j in range(H+1)] for i in range(N+1)] dp[0][0] = 0 #配るdpで考える for i in range(N): for h in range(H+1): #i番目の魔法を使わないとき dp[i+1][h] = min(dp[i][h], dp[i+...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
590,987
590,986
u674574659
python
p02787
H,N = map(int,input().split()) l = [] for i in range(N): l.append( list(map(int,input().split())) ) #dp[i][h]:i番目の魔法まで見てhのダメージを与えるときの最小魔力 dp = [[10**4+1 for j in range(H+1)] for i in range(N+1)] dp[0][0] = 0 #配るdpで考える for i in range(N): for h in range(H): #i番目の魔法を使わないとき dp[i+1][h] = min(dp[i][h], dp[i+1]...
H,N = map(int,input().split()) l = [] for i in range(N): l.append( list(map(int,input().split())) ) #dp[i][h]:i番目の魔法まで見てhのダメージを与えるときの最小魔力 dp = [[10**8+1 for j in range(H+1)] for i in range(N+1)] dp[0][0] = 0 #配るdpで考える for i in range(N): for h in range(H+1): #i番目の魔法を使わないとき dp[i+1][h] = min(dp[i][h], dp[i+...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
590,988
590,986
u674574659
python
p02787
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import accumulate, permutations, combinations, product from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import accumulate, permutations, combinations, product from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase...
[]
590,998
590,999
u279493135
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = max(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,004
591,005
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = min(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,006
591,005
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = max(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,004
591,007
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = max(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,004
591,012
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = min(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,006
591,012
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = max(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,004
591,015
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = min(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,006
591,015
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = min(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i - a] + b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,006
591,025
u706929073
python
p02787
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = min(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [10 ** 18 for _ in range(h + max_a)] dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a]+b for a, b in ab) print(min(dp[h:]))
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change" ]
591,006
591,027
u706929073
python
p02787
inf = 10 ** 18 h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [inf] * (h + max_a) dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(dp[h:])
inf = 10 ** 18 h, n = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(n)] max_a = max(a for a, _ in ab) dp = [inf] * (h + max_a) dp[0] = 0 for i in range(1, h + max_a): dp[i] = min(dp[i-a] + b for a, b in ab) print(min(dp[h:]))
[ "call.arguments.add", "call.arguments.change" ]
591,029
591,030
u706929073
python
p02787
import sys input = sys.stdin.buffer.readline h,n = map(int, input().split()) AB = [list(map(int, input().split())) for _ in range(n)] inf=float("inf") dp=[inf]*(h+1) dp[0]=0 for a,b in AB: for i in range(h): if dp[i]!=float("inf"): dp[min(i+a,h)]=min(dp[min(i+a,h),dp[i]+b]) print(dp[-1]) ...
import sys input = sys.stdin.buffer.readline h,n = map(int, input().split()) AB = [list(map(int, input().split())) for _ in range(n)] inf=float("inf") dp=[inf]*(h+1) dp[0]=0 for a,b in AB: for i in range(h): if dp[i]!=float("inf"): dp[min(i+a,h)]=min(dp[min(i+a,h)],dp[i]+b) print(dp[-1]) ...
[ "call.arguments.change" ]
591,039
591,040
u573754721
python
p02787
import sys input = sys.stdin.readline h, n = map(int, input().split()) A = [] B = [] for i in range(n): a,b=map(int,input().split()) A.append(a) B.append(b) Ama = max(A) dp=[float("inf")]*(h+Ama) dp[0]=0 for i in range(n): for j in range(A[i],h+Ama+1): dp[j]=min(dp[j],dp[j-A[i]+B[i]]) print(...
import sys input = sys.stdin.readline h, n = map(int, input().split()) A = [] B = [] for i in range(n): a,b=map(int,input().split()) A.append(a) B.append(b) Ama = max(A) dp=[float("inf")]*(h+Ama+1) dp[0]=0 for i in range(n): for j in range(A[i],h+Ama+1): dp[j]=min(dp[j],dp[j-A[i]]+B[i]) pri...
[ "call.arguments.change" ]
591,041
591,042
u573754721
python
p02787
#int でsplitを使う場合はmap関数を利用しなければならない H,N = map(int,input().split()) li=[] x=[] for i in range(N): A,B = map(int,input().split()) x.append(A) li.append([A,B]) dp = [10**9]*(H+max(x)) dp[0] = 0 for i in range(1,len(dp)): dp[i] = min(dp[i-a] + b for a,b in li) print(min(dp[h:]))
#int でsplitを使う場合はmap関数を利用しなければならない H,N = map(int,input().split()) li=[] x=[] for i in range(N): A,B = map(int,input().split()) x.append(A) li.append([A,B]) dp = [10**9]*(H+max(x)) dp[0] = 0 for i in range(1,len(dp)): dp[i] = min(dp[i-a] + b for a,b in li) print(min(dp[H:]))
[ "identifier.change", "variable_access.subscript.index.change", "call.arguments.change", "io.output.change" ]
591,055
591,056
u972652761
python
p02787
H, N = map(int,input().split()) data = [] for i in range(N): data.append([0, 0]) a, b = map(int,input().split()) data[i][0] = a data[i][1] = b data.sort(key=lambda x: x[0]) cost = [float("inf")] * (H + data[-1][0]) cost[0] = 0 for i in range(1, H + data[-1][0]): for magic in data: if i < ma...
H, N = map(int,input().split()) data = [] for i in range(N): data.append([0, 0]) a, b = map(int,input().split()) data[i][0] = a data[i][1] = b data.sort(key=lambda x: x[0]) cost = [float("inf")] * (H + data[-1][0]) cost[0] = 0 for i in range(1, H + data[-1][0]): for magic in data: if i < ma...
[ "call.arguments.change" ]
591,059
591,060
u096616343
python
p02787
H, N = map(int, input().split()) A = [list(map(int, input().split())) for i in range(N)] print(H, N) INF = int(1e18) dp = [INF] * (H + 1) dp[H] = 0; for i in range(N): for j in range(H, -1, -1): dp[max(0, j - A[i][0])] = min(dp[max(0, j - A[i][0])], dp[j] + A[i][1]) ans = dp[0] print(ans)
H, N = map(int, input().split()) A = [list(map(int, input().split())) for i in range(N)] INF = int(1e18) dp = [INF] * (H + 1) dp[H] = 0; for i in range(N): for j in range(H, -1, -1): dp[max(0, j - A[i][0])] = min(dp[max(0, j - A[i][0])], dp[j] + A[i][1]) ans = dp[0] print(ans)
[ "call.remove" ]
591,065
591,066
u278868910
python
p02787
from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter import itertools from functools import * from itertools import permutations,combinations,groupby import sys import bisect import string import math import time import random def Golf(): *a,=map(int,open(0)) def S_(): re...
from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter import itertools from functools import * from itertools import permutations,combinations,groupby import sys import bisect import string import math import time import random def Golf(): *a,=map(int,open(0)) def S_(): re...
[ "expression.operation.unary.add", "call.arguments.change" ]
591,196
591,197
u623819879
python
p02787
from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter import itertools from functools import * from itertools import permutations,combinations,groupby import sys import bisect import string import math import time import random def Golf(): *a,=map(int,open(0)) def S_(): re...
from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter import itertools from functools import * from itertools import permutations,combinations,groupby import sys import bisect import string import math import time import random def Golf(): *a,=map(int,open(0)) def S_(): re...
[ "call.arguments.change", "expression.operation.unary.add", "identifier.change" ]
591,198
591,197
u623819879
python
p02787
from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter import itertools from functools import * from itertools import permutations,combinations,groupby import sys import bisect import string import math import time import random def Golf(): *a,=map(int,open(0)) def S_(): re...
from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter import itertools from functools import * from itertools import permutations,combinations,groupby import sys import bisect import string import math import time import random def Golf(): *a,=map(int,open(0)) def S_(): re...
[ "assignment.variable.change", "identifier.change", "call.arguments.change", "expression.operation.unary.add" ]
591,199
591,197
u623819879
python
p02787
h,n = map(int,input().split()) dp = [int(1e18)] * (h+1) dp[0] = 0 for i in range(n): a, b = map(int, input().split()) for j in range(h): nj = min(j+a, h) dp[nj] = min(dp[nj], dp[j]+b) print(dp) print(dp[h])
h,n = map(int,input().split()) dp = [int(1e18)] * (h+1) dp[0] = 0 for i in range(n): a, b = map(int, input().split()) for j in range(h): nj = min(j+a, h) dp[nj] = min(dp[nj], dp[j]+b) print(dp[h])
[ "call.remove" ]
591,202
591,203
u599114793
python
p02787
import math def main(): H,N=map(int,input().split()) inf=float('inf') dp=[0]+[inf]*H for i in range(N): A,B=map(int,input().split()) if A>=H: #dp[-1]=min(B,dp[-1]) if B < dp[-1]: dp[-1]=B else: for j in range(A,H+1): ...
import math def main(): H,N=map(int,input().split()) inf=float('inf') dp=[0]+[inf]*H for i in range(N): A,B=map(int,input().split()) if A>=H: #dp[-1]=min(B,dp[-1]) if B < dp[-1]: dp[-1]=B else: for j in range(A,H+1): ...
[ "call.remove" ]
591,313
591,314
u025241948
python
p02787
# coding=utf-8 # Date: 2020-01-08 # Author: lee215 get = lambda: int(input().strip()) getl = lambda: input().strip() gets = lambda: list(map(int, input().strip().split())) getss = lambda n: [gets() for _ in range(n)] # fi = open('sample3.in', 'r') # input = fi.readline h, N = gets() AB = getss(N) dp = [0] + [float(...
# coding=utf-8 # Date: 2020-01-08 # Author: lee215 get = lambda: int(input().strip()) getl = lambda: input().strip() gets = lambda: list(map(int, input().strip().split())) getss = lambda n: [gets() for _ in range(n)] h, N = gets() AB = getss(N) dp = [0] + [float('inf')] * h for a, b in AB: for i in range(h): ...
[ "assignment.value.change", "identifier.replace.add", "literal.replace.remove", "expression.operation.binary.change", "expression.operation.binary.remove", "call.arguments.change" ]
591,361
591,362
u986014912
python
p02787
def chmin(a, b): if (a > b): return b return a def chmax(a, b): if (a < b): return b return a H, N = map(int, input().split()) li = [list(map(int, input().split())) for i in range(N)] dp = [[10**3] * (H+1) for i in range(N+1)] dp[0][0] = 0 for n in range(N): for h in range(0, H+1): dp[n+1][h...
def chmin(a, b): if (a > b): return b return a def chmax(a, b): if (a < b): return b return a H, N = map(int, input().split()) li = [list(map(int, input().split())) for i in range(N)] dp = [[10**9] * (H+1) for i in range(N+1)] dp[0][0] = 0 for n in range(N): for h in range(0, H+1): dp[n+1][h...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
591,404
591,405
u431981421
python
p02787
h, n = map(int, input().split()) a = [] b = [] for i in range(n): a_, b_ = map(int, input().split()) a.append(a_) b.append(b_) dp = [float("inf")] * (h + 1010) dp[0] = 0 for i in range(h + 1): for j in range(n): dp[i + a[j]] = min(dp[i + a[j]], dp[i] + b[j]) print(min(dp[h:]))
h, n = map(int, input().split()) a = [] b = [] for i in range(n): a_, b_ = map(int, input().split()) a.append(a_) b.append(b_) dp = [float("inf")] * (h + 10010) dp[0] = 0 for i in range(h + 1): for j in range(n): dp[i + a[j]] = min(dp[i + a[j]], dp[i] + b[j]) print(min(dp[h:]))
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
591,423
591,424
u737298927
python
p02787
# coding: utf-8 import re import math import fractions import random from heapq import heappop,heappush import time import sys readline = sys.stdin.readline #import numpy as np mod=int(10**9+7) inf=int(10**20) class union_find(): def __init__(self,n): self.n=n self.P=[a for a in range(N)] se...
# coding: utf-8 import re import math import fractions import random from heapq import heappop,heappush import time import sys readline = sys.stdin.readline #import numpy as np mod=int(10**9+7) inf=int(10**20) class union_find(): def __init__(self,n): self.n=n self.P=[a for a in range(N)] se...
[ "call.arguments.change" ]
591,464
591,465
u902151549
python
p02787
#モンスターの体力は H #トキはN種類の魔法が使え、 #i番目の魔法を使うと、モンスターの体力を Ai減らすことができますが、 #トキの魔力を Bi消耗します。 #dp[i] = モンスターの体力を i 減らすため消耗する魔力の最小値 #dp[i+1] = min(dp[i-Ai]+Bi,dp[i]) #dp[0]=0 h, n = map(int, input().split()) dp=[10**8]*(10**5+1) ab = [list(map(int, input().split())) for _ in range(n)] for i in range(1,h+1): for j in range(0,n...
#モンスターの体力は H #トキはN種類の魔法が使え、 #i番目の魔法を使うと、モンスターの体力を Ai減らすことができますが、 #トキの魔力を Bi消耗します。 #dp[i] = モンスターの体力を i 減らすため消耗する魔力の最小値 #dp[i+1] = min(dp[i-Ai]+Bi,dp[i]) #dp[0]=0 h, n = map(int, input().split()) dp=[10**8]*(10**5+1) ab = [list(map(int, input().split())) for _ in range(n)] for i in range(1,h+1): for j in range(0,n...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
591,466
591,467
u866374539
python
p02787
h,n = map(int,input().split()) dg = 10**5 ba = [] for _ in [0]*n: a,b = map(int,input().split()) if a >= h: a = h ba.append(b*dg + a) ba.sort() d = [10**9]*(h+1) d[0] = 0 for i in range(1, h+1): for e in ba: a,b = e%dg, e//dg if i<=a: if d[i] > b: d...
h,n = map(int,input().split()) dg = 10**5 ba = [] for _ in [0]*n: a,b = map(int,input().split()) if a >= h: a = h ba.append(b*dg + a) ba.sort() d = [10**9]*(h+1) d[0] = 0 for i in range(1, h+1): for e in ba: a,b = e%dg, e//dg if i<=a: if d[i] > b: d...
[ "assignment.value.change", "identifier.replace.add", "literal.replace.remove", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
591,483
591,484
u672475305
python
p02787
import math def inputIntList(): return [int(s) for s in input().split()] def inputInt(): return int(input()) inf = float('inf') def main(): H, N = inputIntList() AB = [inputIntList() for _ in range(N)] dp = [inf for _ in range(H + 1)] dp[0] = 0 for (a, m) in AB: for h in range(H): nxt =...
import math def inputIntList(): return [int(s) for s in input().split()] def inputInt(): return int(input()) inf = float('inf') def main(): H, N = inputIntList() AB = [inputIntList() for _ in range(N)] dp = [inf for _ in range(H + 1)] dp[0] = 0 for (a, m) in AB: for h in range(H): nxt =...
[ "call.remove" ]
591,548
591,549
u343128979
python
p02787
H,N = map(int,input().split()) A = [] B = [] for i in range(N): a,b = map(int,input().split()) A.append(a) B.append(b) x = max(A) dp = [10**9 for i in range(H+x+1)] dp[0] = 0 for i in range(N): a = A[i] b = B[i] for j in range(H+x+1): if j < a: continue dp[j] = min(dp...
H,N = map(int,input().split()) A = [] B = [] for i in range(N): a,b = map(int,input().split()) A.append(a) B.append(b) x = max(A) dp = [10**9 for i in range(H+x+1)] dp[0] = 0 for i in range(N): a = A[i] b = B[i] for j in range(H+x+1): if j < a: continue dp[j] = min(dp...
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change" ]
591,550
591,551
u557494880
python
p02787
# 解き直し H, N = map(int, input().split()) A_to_minB = {} max_A = -1 for i in range(N): a, b = map(int, input().split()) max_A = max(max_A, a) if a not in set(A_to_minB.keys()): A_to_minB[a] = b else: A_to_minB[a] = min(A_to_minB[a], b) dp = [float("inf")] * (H + max_A) dp[0] = 0 for i in r...
# 解き直し H, N = map(int, input().split()) A_to_minB = {} max_A = -1 for i in range(N): a, b = map(int, input().split()) max_A = max(max_A, a) if a not in set(A_to_minB.keys()): A_to_minB[a] = b else: A_to_minB[a] = min(A_to_minB[a], b) dp = [float("inf")] * (H + max_A) dp[0] = 0 for i in r...
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change" ]
591,604
591,605
u894934980
python
p02787
h,n=map(int,input().split()) a=[0]*n b=[0]*n inf=10**10 for i in range(n): a[i],b[i]=map(int,input().split()) dp = [[inf for i in range(h+1)] for j in range(n+1)] for i in range(n): cnt=1 for j in range(h+1): if j-a[i]<0: dp[i+1][j]=min(dp[i][j],dp[i][j-a[i]]+b[i],b[i]*cnt) ...
h,n=map(int,input().split()) a=[0]*n b=[0]*n inf=10**10 for i in range(n): a[i],b[i]=map(int,input().split()) dp = [[inf for i in range(h+1)] for j in range(n+1)] for i in range(n): cnt=1 for j in range(h+1): if j-a[i]<0: dp[i+1][j]=min(dp[i][j],dp[i][0]+b[i],b[i]*cnt) ...
[ "assignment.value.change", "identifier.replace.remove", "literal.replace.add", "variable_access.subscript.index.change", "call.arguments.change", "expression.operation.binary.change", "expression.operation.binary.remove" ]
591,668
591,669
u727787724
python
p02787
def resolve(): H,N=(int(i) for i in input().split()) magics=[[int(i) for i in input().split()] for j in range(N)] mx=2**31 dpt=[mx for i in range(H+1)] dpt[-1]=0 for i in range(H,-1,-1): current=dpt[i] if current> dpt[0]: continue for m in magics: ...
def resolve(): H,N=(int(i) for i in input().split()) magics=[[int(i) for i in input().split()] for j in range(N)] mx=2**31 dpt=[mx for i in range(H+1)] dpt[-1]=0 for i in range(H,0,-1): current=dpt[i] if current> dpt[0]: continue for m in magics: ...
[ "call.arguments.change", "control_flow.loop.range.bounds.step.change", "expression.operation.unary.remove" ]
591,754
591,755
u307592354
python
p02782
r1,c1,r2,c2=map(int,input().split()) mod=10**9+7 def comb(n,k,mod): if n<k: return 0 if n-k<k: k=n-k c=1 for x in range(n-k+1,n+1): c=(c*x)%mod d=1 for x in range(1,k+1): d=(d*x)%mod c=c*pow(d,mod-2,mod) return c%mod def f(i,j): return comb(i+j,i,mod) ans=f(r2+1,c2+1)-f(r2+1,c1)-f(r1,c...
r1,c1,r2,c2=map(int,input().split()) mod=10**9+7 def comb(n,k,mod): if n<k: return 0 if n-k<k: k=n-k c=1 for x in range(n-k+1,n+1): c=(c*x)%mod d=1 for x in range(1,k+1): d=(d*x)%mod c=c*pow(d,mod-2,mod) return c%mod def f(i,j): return comb(i+j,i,mod) ans=f(r2+1,c2+1)-f(r2+1,c1)-f(r1,c...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
591,932
591,933
u333700164
python
p02782
r1,c1,r2,c2 = map(int,input().split()) mod = 10**9+7 def p_mod(m,n,p): a = 1 for i in range(n): a = a*(m-i) % p return a def c_mod(m,n,p): return (p_mod(m,n,p)*pow(p_mod(n,n,p),p-2,p)) % p print(c_mod(r2+c2+2,r2+1,mod) - c_mod(r1+c2+1,r1,mod) - c_mod(r2+c1+1,c1,mod) + c_mod(r1+c1,r1,mod))
r1,c1,r2,c2 = map(int,input().split()) mod = 10**9+7 def p_mod(m,n,p): a = 1 for i in range(n): a = a*(m-i) % p return a def c_mod(m,n,p): return (p_mod(m,n,p)*pow(p_mod(n,n,p),p-2,p)) % p print((c_mod(r2+c2+2,r2+1,mod) - c_mod(r1+c2+1,r1,mod) - c_mod(r2+c1+1,c1,mod) + c_mod(r1+c1,r1,mod)) % ...
[ "call.arguments.change", "call.arguments.add" ]
592,028
592,029
u119148115
python
p02782
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): r,c,rr,cc=map(int,input().split...
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): r,c,rr,cc=map(int,input().split...
[]
592,040
592,041
u714642969
python
p02788
n, d, a = map(int, input().split()) l = [[0, 0] for _ in range(n)] for i in range(n): x, h = map(int, input().split()) l[i][0] = x l[i][1] = h l.sort() print(l) from collections import deque d = 2*d q = deque([]) total = 0 ans = 0 for i in range(n): x = l[i][0] h = l[i][1] if q: while q[0][0] < x: ...
n, d, a = map(int, input().split()) l = [[0, 0] for _ in range(n)] for i in range(n): x, h = map(int, input().split()) l[i][0] = x l[i][1] = h l.sort() from collections import deque d = 2*d q = deque([]) total = 0 ans = 0 for i in range(n): x = l[i][0] h = l[i][1] if q: while q[0][0] < x: tota...
[ "call.remove" ]
592,171
592,172
u186838327
python
p02788
from collections import deque def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): """ explosion = FIFO deque and damage, range """ N, D, A = read_ints() XH = [] for _ in range(N): XH.append(read_ints())...
from collections import deque def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): """ explosion = FIFO deque and damage, range """ N, D, A = read_ints() XH = [] for _ in range(N): XH.append(read_ints())...
[ "identifier.change", "call.arguments.change" ]
592,257
592,258
u309716323
python
p02788
import sys import bisect read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines in_n = lambda: int(readline()) in_nn = lambda: map(int, readline().split()) in_s = lambda: readline().rstrip().decode('utf-8') in_nl = lambda: list(map(int, readline().split())) in_nl2 = l...
import sys import bisect read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines in_n = lambda: int(readline()) in_nn = lambda: map(int, readline().split()) in_s = lambda: readline().rstrip().decode('utf-8') in_nl = lambda: list(map(int, readline().split())) in_nl2 = l...
[ "control_flow.branch.if.add" ]
592,264
592,265
u163783894
python
p02788
from collections import deque from math import ceil n,d,a = map(int,input().split()) M = [list(map(int,input().split())) for i in range(n)] M = [[x,ceil(h/a)] for x,h in M] M = sorted(M) que = deque() ans = 0 atack = 0 for x,h in M: if len(que) > 0: if que[0][0] < x: tx,ta = que.popleft() atack -= ...
from collections import deque from math import ceil n,d,a = map(int,input().split()) M = [list(map(int,input().split())) for i in range(n)] M = [[x,ceil(h/a)] for x,h in M] M = sorted(M) que = deque() ans = 0 atack = 0 for x,h in M: while len(que) > 0 and que[0][0] < x: tx,ta = que.popleft() atack -= ta ...
[ "control_flow.branch.while.replace.add", "control_flow.loop.if.replace.remove" ]
592,272
592,273
u898967808
python
p02788
import math from collections import deque N,D,A = map(int,input().split()) monsters = [ list(map(int,input().split())) for _ in range(N) ] monsters = [ [x, math.ceil(h/A)] for x,h in monsters ] que = deque() cur = 0 ans = 0 for x,h in monsters: while que and x > que[0][0]: _,n = que.popleft() cur -= n nee...
import math from collections import deque N,D,A = map(int,input().split()) monsters = sorted([ list(map(int,input().split())) for _ in range(N) ]) monsters = [ [x, math.ceil(h/A)] for x,h in monsters ] # print(monsters) que = deque() cur = 0 ans = 0 for x,h in monsters: while que and x > que[0][0]: _,n = que.popl...
[ "call.add", "call.arguments.change" ]
592,274
592,275
u723711163
python
p02788
from collections import deque n,d,a = map(int, input().split()) xhl = [] for _ in range(n): x,h = map(int, input().split()) cnt = (h-1)//a + 1 xhl.append((x,cnt)) attack_q = deque([]) attack_sum = 0 ans = 0 for x,h in xhl: while attack_q and attack_q[0][0] < x: poped_cnt = attack_q.popleft()[1...
from collections import deque n,d,a = map(int, input().split()) xhl = [] for _ in range(n): x,h = map(int, input().split()) cnt = (h-1)//a + 1 xhl.append((x,cnt)) xhl.sort() attack_q = deque([]) attack_sum = 0 ans = 0 for x,h in xhl: # print('----',((x,h))) # print(attack_q) # print(attack_su...
[ "call.add" ]
592,282
592,283
u493520238
python
p02788
from collections import deque n,d,a=map(int,input().split()) xh=[list(map(int,input().split())) for _ in range(n)] xh.sort() d=2*d ans=0 total=0 q=deque() for i in range(n): x,h=xh[i] while len(q)>=1 and x>q[0][0]: total-=q.popleft()[1] h-=total if h>0: num=(h-1//a)+1 damage=a*num ans+=num t...
from collections import deque n,d,a=map(int,input().split()) xh=[list(map(int,input().split())) for _ in range(n)] xh.sort() d=2*d ans=0 total=0 q=deque() for i in range(n): x,h=xh[i] while len(q)>=1 and x>q[0][0]: total-=q.popleft()[1] h-=total if h>0: num=(h-1)//a+1 damage=a*num ans+=num t...
[]
592,306
592,307
u333700164
python
p02788
from collections import deque n,d,a=map(int,input().split()) xh=[list(map(int,input().split())) for _ in range(n)] xh.sort() d=2*d ans=0 total=0 q=deque() for i in range(n): x,h=xh[i] while len(q)>=1 and x>q[0][0]: total-=q.popleft()[1] h-=total if h>0: num=(h-h%a)//a damage=a*num ans+=num t...
from collections import deque n,d,a=map(int,input().split()) xh=[list(map(int,input().split())) for _ in range(n)] xh.sort() d=2*d ans=0 total=0 q=deque() for i in range(n): x,h=xh[i] while len(q)>=1 and x>q[0][0]: total-=q.popleft()[1] h-=total if h>0: num=(h-1)//a+1 damage=a*num ans+=num t...
[ "assignment.value.change", "identifier.replace.remove", "literal.replace.add", "expression.operation.binary.change", "expression.operation.binary.remove" ]
592,308
592,307
u333700164
python
p02788
from collections import deque n, d, a = map(int, input().split()) mons = [] for i in range(n): x, h = map(int, input().split()) mons.append((x, h)) mons = sorted(mons) print(mons) q = deque() dm_sum = 0 ans = 0 for i in range(n): while dm_sum > 0: if q[0][0] < mons[i][0]: cur = q...
from collections import deque n, d, a = map(int, input().split()) mons = [] for i in range(n): x, h = map(int, input().split()) mons.append((x, h)) mons = sorted(mons) q = deque() dm_sum = 0 ans = 0 for i in range(n): while dm_sum > 0: if q[0][0] < mons[i][0]: cur = q.popleft() ...
[ "call.remove" ]
592,356
592,357
u353402627
python
p02788
from collections import deque n, d, a = map(int, input().split()) mons = [] for i in range(n): x, h = map(int, input().split()) mons.append((x, h)) mons = sorted(mons) q = deque() dm_sum = 0 ans = 0 for i in range(n): if dm_sum > 0: if q[0][0] < mons[i][0]: cur = q.popleft() ...
from collections import deque n, d, a = map(int, input().split()) mons = [] for i in range(n): x, h = map(int, input().split()) mons.append((x, h)) mons = sorted(mons) q = deque() dm_sum = 0 ans = 0 for i in range(n): while dm_sum > 0: if q[0][0] < mons[i][0]: cur = q.popleft() ...
[ "control_flow.branch.while.replace.add", "control_flow.loop.if.replace.remove", "control_flow.break.add" ]
592,358
592,357
u353402627
python
p02788
from math import ceil from collections import deque n, d, a = map(int, input().split()) m = [list(map(int, input().split())) for _ in range(n)] m = [[x, ceil(h/a)] for x, h in m] acc_damage = 0 que = deque() ans = 0 for x, h in m: while que and x > que[0][0]: limit, damage = que.popleft() acc_dama...
from math import ceil from collections import deque n, d, a = map(int, input().split()) m = sorted([list(map(int, input().split())) for _ in range(n)]) m = [[x, ceil(h / a)] for x, h in m] acc_damage = 0 que = deque() ans = 0 for x, h in m: while que and x > que[0][0]: limit, damage = que.popleft() ...
[ "call.add", "call.arguments.change" ]
592,365
592,366
u653837719
python
p02788
from math import ceil from collections import deque n, d, a = map(int, input().split()) m = sorted([list(map(int, input().split())) for _ in range(n)]) m = [[x, ceil(h / A)] for x, h in m] acc_damage = 0 que = deque() ans = 0 for x, h in m: while que and x > que[0][0]: limit, damage = que.popleft() ...
from math import ceil from collections import deque n, d, a = map(int, input().split()) m = sorted([list(map(int, input().split())) for _ in range(n)]) m = [[x, ceil(h / a)] for x, h in m] acc_damage = 0 que = deque() ans = 0 for x, h in m: while que and x > que[0][0]: limit, damage = que.popleft() ...
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
592,367
592,368
u653837719
python
p02788
from heapq import heappush, heappop n, d, a = map(int, input().split()) actions = [] for _ in range(n): x, h = map(int, input().split()) heappush(actions, (x, 0, h // a)) cnt = 0 bomb = 0 current_bomb = 0 while cnt < n: a, c, b = heappop(actions) if c: current_bomb -= b continue els...
from heapq import heappush, heappop n, d, a = map(int, input().split()) actions = [] for _ in range(n): x, h = map(int, input().split()) heappush(actions, (x, 0, (h + a - 1) // a)) cnt = 0 bomb = 0 current_bomb = 0 while cnt < n: a, c, b = heappop(actions) if c: current_bomb -= b contin...
[ "call.arguments.change" ]
592,371
592,372
u994521204
python
p02788
import sys input = sys.stdin.readline n,d,a = map(int,input().split()) xh = [list(map(int,input().split())) for _ in range(n)] xh.sort() class Bit: def __init__(self, n): self.size = n self.tree = [0]*(n+1) self.depth = n.bit_length() def __iter__(self): psum = 0 for ...
import sys input = sys.stdin.readline n,d,a = map(int,input().split()) xh = [list(map(int,input().split())) for _ in range(n)] xh.sort() class Bit: def __init__(self, n): self.size = n self.tree = [0]*(n+1) self.depth = n.bit_length() def __iter__(self): psum = 0 for ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
592,384
592,385
u623231048
python
p02788
import sys, heapq input = sys.stdin.readline N, D, A = [int(_) for _ in input().split()] XH = [[int(_) for _ in input().split()] for _ in range(N)] He = [[2 * x, h, 0] for x, h in XH] heapq.heapify(He) now = 0 ans = 0 while He: x, h, t = heapq.heappop(He) if t: now -= h else: if h - D * now ...
import sys, heapq input = sys.stdin.readline N, D, A = [int(_) for _ in input().split()] XH = [[int(_) for _ in input().split()] for _ in range(N)] He = [[2 * x, h, 0] for x, h in XH] heapq.heapify(He) now = 0 ans = 0 while He: x, h, t = heapq.heappop(He) if t: now -= h else: if h - A * now ...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
592,403
592,404
u844789719
python
p02788
from collections import deque import math N, D, A = map(int, input().split()) monster = [list(map(int, input().split())) for _ in range(N)] monster.sort(key=lambda x:x[0]) bomb = deque() s = 0 ans = 0 for i in range(N): x, h = monster[i] while len(bomb) > 0 and bomb[0][1] < x: s -= bomb.popleft()[2] ...
from collections import deque import math N, D, A = map(int, input().split()) monster = [list(map(int, input().split())) for _ in range(N)] monster.sort(key=lambda x:x[0]) bomb = deque() s = 0 ans = 0 for i in range(N): x, h = monster[i] while len(bomb) > 0 and bomb[0][1] < x: s -= bomb.popleft()[2] ...
[ "call.arguments.change" ]
592,422
592,423
u419877586
python
p02788
from collections import deque N, D, A=map(int, input().split()) XH=[list(map(int, input().split())) for _ in range(N)] XH.sort(key=lambda x:x[0]) total=0 q=deque() ans=0 for i in range(N): X, H=XH[i] while len(q) and q[0][0]<X: total-=q.pop()[1] H-=total if H>0: attack_cnt=(H-1)//A+1 ans+=attack_c...
from collections import deque N, D, A=map(int, input().split()) XH=[list(map(int, input().split())) for _ in range(N)] XH.sort(key=lambda x:x[0]) total=0 q=deque() ans=0 for i in range(N): X, H=XH[i] while len(q) and q[0][0]<X: total-=q.popleft()[1] H-=total if H>0: attack_cnt=(H-1)//A+1 ans+=atta...
[ "identifier.change" ]
592,424
592,425
u419877586
python
p02788
import math n, d, a = map(int,input().split()) e = [[] for i in range(n)] for i in range(n): x, h = map(int,input().split()) e[i] = [x,h] num = 0 e.sort() sd = [0 for i in range(n)] l = [i for i in range(n)] for i in range(n): for j in range(l[i-1],i): if e[i][0]-e[j][0] <= 2*d: l[i] = ...
import math n, d, a = map(int,input().split()) e = [[] for i in range(n)] for i in range(n): x, h = map(int,input().split()) e[i] = [x,h] num = 0 e.sort() sd = [0 for i in range(n)] l = [i for i in range(n)] for i in range(n): for j in range(l[i-1],i): if e[i][0]-e[j][0] <= 2*d: l[i] = ...
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
592,432
592,433
u169350228
python
p02788
f=lambda:map(int,input().split()) n,d,a=f() lt=sorted([tuple(f()) for _ in range(n)]) from collections import * q=deque() c=s=0 for x,h in lt: while q and q[0][0]<x: s+=q.popleft()[1] h-=s t=-h//a c-=t s-=t*a q.append((x+d*2,t*a)) print(c)
f=lambda:map(int,input().split()) n,d,a=f() lt=sorted([tuple(f()) for _ in range(n)]) from collections import * q=deque() c=s=0 for x,h in lt: while q and q[0][0]<x: s+=q.popleft()[1] h-=s if h<1: continue t=-h//a c-=t s-=t*a q.append((x+d*2,t*a)) print(c)
[ "control_flow.branch.if.add" ]
592,436
592,437
u133936772
python
p02788
import sys input = sys.stdin.readline import bisect import collections from collections import deque n,d,a= map(int, input().split()) x= [list(map(int, input().split())) for i in range(n)] x.sort() y=[] for i in range(n): y.append(x[i][0]) x[i][1]=-(-x[i][1]//a) # どのモンスターまで倒したか管理しながら進める。 # 累積ダメージを管理 qq=deque(...
import sys input = sys.stdin.readline import bisect import collections from collections import deque n,d,a= map(int, input().split()) x= [list(map(int, input().split())) for i in range(n)] x.sort() y=[] for i in range(n): y.append(x[i][0]) x[i][1]=-(-x[i][1]//a) # どのモンスターまで倒したか管理しながら進める。 # 累積ダメージを管理 qq=deque(...
[ "control_flow.branch.while.replace.add", "control_flow.loop.if.replace.remove", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
592,460
592,461
u970899068
python
p02788
from collections import deque N, D, A = map(int, input().split()) mons = [] for _ in range(N): X, H = map(int, input().split()) mons.append((X, (H + A - 1) // A)) mons.sort() ans = 0 q = deque([]) tot = 0 for x, h in mons: while q: x0, h0 = next(iter(q)) if x - 2 * D <= x0: bre...
from collections import deque N, D, A = map(int, input().split()) mons = [] for _ in range(N): X, H = map(int, input().split()) mons.append((X, (H + A - 1) // A)) mons.sort() ans = 0 q = deque([]) tot = 0 for x, h in mons: while q: x0, h0 = next(iter(q)) if x - 2 * D <= x0: bre...
[]
592,484
592,485
u794145298
python
p02788
# https://atcoder.jp/contests/abc153/tasks/abc153_f # 座標圧縮、貪欲法、imos法 import sys read = sys.stdin.readline def read_ints(): return list(map(int, read().split())) def read_tuple(H): ''' H is number of rows ''' ret = [] for _ in range(H): ret.append(tuple(map(int, read().split()))) ...
# https://atcoder.jp/contests/abc153/tasks/abc153_f # 座標圧縮、貪欲法、imos法 import sys read = sys.stdin.readline def read_ints(): return list(map(int, read().split())) def read_tuple(H): ''' H is number of rows ''' ret = [] for _ in range(H): ret.append(tuple(map(int, read().split()))) ...
[ "identifier.change", "variable_access.subscript.index.change", "call.arguments.change", "call.arguments.keyword_argument.change" ]
592,549
592,550
u179169725
python
p02788
from collections import deque import math n, d, a = map(int, input().split()) data = [] for i in range(n): data.append(list(map(int, input().split()))) data.sort() dam = 0 ans = 0 q = deque() for i in range(n): x,h = data[i] while q: k = q.popleft() if k[1] >= x: q.appendleft(k) ...
from collections import deque import math n, d, a = map(int, input().split()) data = [] for i in range(n): data.append(list(map(int, input().split()))) data.sort() dam = 0 ans = 0 q = deque() for i in range(n): x,h = data[i] while q: k = q.popleft() if k[1] >= x: q.appendleft(k) ...
[ "call.remove" ]
592,600
592,601
u691896522
python
p02788
from collections import deque import math n, d, a = map(int, input().split()) data = [] for i in range(n): data.append(list(map(int, input().split()))) data.sort() dam = 0 ans = 0 q = deque() for i in range(n): x,h = data[i] while q: k = q.popleft() if k[1] >= x: q.appendleft(k) ...
from collections import deque import math n, d, a = map(int, input().split()) data = [] for i in range(n): data.append(list(map(int, input().split()))) data.sort() dam = 0 ans = 0 q = deque() for i in range(n): x,h = data[i] while q: k = q.popleft() if k[1] >= x: q.appendleft(k) ...
[ "call.remove" ]
592,600
592,606
u691896522
python
p02788
n, d, a = map(int, input().split()) D = True pos = [] pos1 = [] for i in range(n): x, h = map(int, input().split()) pos.append((x, h)) pos.sort(key=lambda x: x[0]) bombs = 0 damage = 0 y, z = 0, 0 while y < n: x0 = pos[y][0] try: x1 = pos1[z][0] except IndexError: x1 = 1e16 if x0 <= x1: health = pos[...
n, d, a = map(int, input().split()) D = True pos = [] pos1 = [] for i in range(n): x, h = map(int, input().split()) pos.append((x, h)) pos.sort(key=lambda x: x[0]) bombs = 0 damage = 0 y, z = 0, 0 while y < n: x0 = pos[y][0] try: x1 = pos1[z][0] except IndexError: x1 = 1e16 if x0 <= x1: health = pos[...
[ "call.add", "call.arguments.change" ]
592,686
592,687
u218071226
python
p02788
from collections import deque N,D,A = map(int, input().split()) ps = [] def ceil(a,b): return -(-a//b) for i in range(N): x,h = map(int, input().split()) ps.append([x,h]) ps.sort() damage = 0 cnt = 0 q = deque([]) for x,h in ps: while len(q) > 0 and q[0][0] < x: # 範囲外のものはダメージを与えられない _,...
from collections import deque N,D,A = map(int, input().split()) ps = [] def ceil(a,b): return -(-a//b) for i in range(N): x,h = map(int, input().split()) ps.append([x,h]) ps.sort() damage = 0 cnt = 0 q = deque([]) for x,h in ps: while len(q) > 0 and q[0][0] < x: # 範囲外のものはダメージを与えられない _,...
[ "call.arguments.change" ]
592,714
592,715
u545368057
python
p02788
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools import time,random sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 10**9+7 mod2 = 998244353 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return lis...
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools import time,random sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 10**9+7 mod2 = 998244353 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return lis...
[ "identifier.change", "expression.operation.binary.change", "call.arguments.change" ]
592,718
592,719
u637175065
python
p02788
def wczytaj_liste(): ciag = input() rozdzielona_lista = ciag.split() odp = [] for wyraz in rozdzielona_lista: liczba = int(wyraz) odp.append(liczba) return odp def F_symulacja(): N, D, A = wczytaj_liste() monstery = [] for i in range(N): x, h = wczytaj_liste() ...
def wczytaj_liste(): ciag = input() rozdzielona_lista = ciag.split() odp = [] for wyraz in rozdzielona_lista: liczba = int(wyraz) odp.append(liczba) return odp def F_symulacja(): N, D, A = wczytaj_liste() monstery = [] for i in range(N): x, h = wczytaj_liste() ...
[ "assignment.change" ]
592,727
592,728
u443725372
python
p02788
# --*-coding:utf-8-*-- import math N,D,A = map(int, input().split()) XH = sorted(tuple(map(int, input().split())) for _ in range(N)) Q = [] qIdx = 0 s = 0 t = 0 for (x, h) in XH: while qIdx < len(Q) and Q[qIdx][0] < x: s -= Q[qIdx][1] qIdx += 1 if s < h: q = int(math.ceil((h-s)/A)...
# --*-coding:utf-8-*-- import math N,D,A = map(int, input().split()) XH = sorted(tuple(map(int, input().split())) for _ in range(N)) Q = [] qIdx = 0 s = 0 t = 0 for (x, h) in XH: while qIdx < len(Q) and Q[qIdx][0] < x: s -= Q[qIdx][1] qIdx += 1 if s < h: q = int(math.ceil((h-s)/A)...
[ "expression.operation.binary.add" ]
592,747
592,748
u729417323
python
p02788
# --*-coding:utf-8-*-- import math N,D,A = map(int, input().split()) XH = sorted(tuple(map(int, input().split())) for _ in range(N)) Q = [] qIdx = 0 s = 0 t = 0 for (x, h) in XH: while qIdx < len(Q) and Q[qIdx][0] < x: s -= Q[qIdx][1] qIdx += 1 if s < h: q = int(math.ceil((h-s)/A)...
# --*-coding:utf-8-*-- import math N,D,A = map(int, input().split()) XH = sorted(tuple(map(int, input().split())) for _ in range(N)) Q = [] qIdx = 0 s = 0 t = 0 for (x, h) in XH: while qIdx < len(Q) and Q[qIdx][0] < x: s -= Q[qIdx][1] qIdx += 1 if s < h: q = int(math.ceil((h-s)/A)...
[ "expression.operation.binary.add" ]
592,747
592,749
u729417323
python
p02788
from collections import deque # input N, D, A = map(int, input().split()) XH = [tuple(map(int, input().split())) for _ in range(N)] # process XH.sort() print(XH) ans = 0 dq = deque() dam = 0 for x, h in XH: while dq: x2, h2 = dq[0] if x > x2: dam -= h2 dq.popleft() ...
from collections import deque # input N, D, A = map(int, input().split()) XH = [tuple(map(int, input().split())) for _ in range(N)] # process XH.sort() #print(XH) ans = 0 dq = deque() dam = 0 for x, h in XH: while dq: x2, h2 = dq[0] if x > x2: dam -= h2 dq.popleft() ...
[ "call.remove" ]
592,795
592,796
u563676207
python
p02788
from operator import itemgetter import bisect import math N,d,a = map(int, input().split()) xh = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(0)) x = [] for X,h in xh: x.append(X) ans = 0 attack_start = [i for i in range(N)] now = 0 cumsum = [0] * (N+1) for L,(X,H) in enumerate(xh): R...
from operator import itemgetter import bisect import math N,d,a = map(int, input().split()) xh = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(0)) x = [] for X,h in xh: x.append(X) ans = 0 attack_start = [i for i in range(N)] now = 0 cumsum = [0] * (N+1) for L,(X,H) in enumerate(xh): R...
[ "call.add", "call.arguments.change" ]
592,816
592,817
u102960641
python
p02788
import math from collections import deque n,d,a = map(int,input().split()) lst1 = [list(map(int,input().split())) for i in range(n)] lst1.sort() #解法1 - 貪欲法 """ キューを使った貪欲法で間に合わせる。 que = [[ダメージ量,そのダメージがどこまで使えるか],...] とすることにより、高速にダメージ管理をすることができる。 """ que = deque() ans = 0 dmg = 0 for i in range(n): while que: ...
import math from collections import deque n,d,a = map(int,input().split()) lst1 = [list(map(int,input().split())) for i in range(n)] lst1.sort() #解法1 - 貪欲法 """ キューを使った貪欲法で間に合わせる。 que = [[ダメージ量,そのダメージがどこまで使えるか],...] とすることにより、高速にダメージ管理をすることができる。 """ que = deque() ans = 0 dmg = 0 for i in range(n): while que: ...
[ "call.add" ]
592,825
592,826
u372144784
python
p02788
import sys input = sys.stdin.buffer.readline from operator import itemgetter from collections import deque def main(): N,D,A = map(int,input().split()) X = [tuple(map(int,input().split())) for _ in range(N)] X.sort(key=itemgetter(0)) aldam = 0 count = 0 q = deque([]) for now,dam in X: ...
import sys input = sys.stdin.buffer.readline from operator import itemgetter from collections import deque def main(): N,D,A = map(int,input().split()) X = [tuple(map(int,input().split())) for _ in range(N)] X.sort(key=itemgetter(0)) aldam = 0 count = 0 q = deque([]) for now,dam in X: ...
[ "call.arguments.change" ]
592,831
592,832
u648212584
python
p02788
n,d,a = map(int,input().split()) lst = [[int(i) for i in input().split()] for _ in range(n)] lst.sort(key=lambda x:x[0]) x = [0]*n h = [0]*n for i in range(n): x[i],h[i] = lst[i] length = [0]*n for i in range(n): left = i+1 right = n-1 while left <= right: mid = (left+right)//2 if x[mid] - ...
n,d,a = map(int,input().split()) lst = [[int(i) for i in input().split()] for _ in range(n)] lst.sort(key=lambda x:x[0]) x = [0]*n h = [0]*n for i in range(n): x[i],h[i] = lst[i] length = [0]*n for i in range(n): left = i+1 right = n-1 while left <= right: mid = (left+right)//2 if x[mid] - ...
[ "control_flow.branch.while.replace.add", "control_flow.loop.if.replace.remove" ]
592,843
592,844
u677121387
python