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
p02823
N,A,B = list(map(int,input().split())) if (A-B)%2 == 0: print((max(A,B)-min(A,B))//2) else: print(min(min(A,B)+(max(A,B)-min(A,B))//2, N-max(A,B)+ (max(A,B)-min(A,B))//2))
N,A,B = list(map(int,input().split())) if (A-B)%2 == 0: print((max(A,B)-min(A,B))//2) else: print(min(min(A,B)+(max(A,B)-min(A,B))//2, N-max(A,B)+1 + (max(A,B)-min(A,B))//2))
[ "expression.operation.binary.add" ]
628,270
628,271
u441575327
python
p02823
n, a, b = map(int, input().split()) if abs(a - b) % 2: te = [a - 1, b - 1] te.sort() rem = te[1] - te[0] + 1 cand1 = te[0] + rem // 2 te = [n - a, n - b] te.sort() rem = te[1] - te[0] + 1 cand2 = te[0] + rem // 2 print(min(cand2, cand2)) else: print(abs(a-b)//2)
n, a, b = map(int, input().split()) if abs(a - b) % 2: te = [a - 1, b - 1] te.sort() rem = te[1] - te[0] + 1 cand1 = te[0] + rem // 2 te = [n - a, n - b] te.sort() rem = te[1] - te[0] + 1 cand2 = te[0] + rem // 2 print(min(cand1, cand2)) else: print(abs(a-b)//2)
[ "identifier.change", "call.arguments.change", "io.output.change" ]
628,278
628,279
u711539583
python
p02823
N, A, B = map(int, input().split()) A, B = min(A, B), max(A, B) if (B - A) % 2 == 0: print((B - A) // 2) else: L = B - 1 R = N - A if R < L: print((R + (N - A) + 1) // 2) else: print((L + (B - 1) + 1) // 2)
N, A, B = map(int, input().split()) A, B = min(A, B), max(A, B) if (B - A) % 2 == 0: print((B - A) // 2) else: L = A - 1 R = N - B if R < L: print((R + (N - A) + 1) // 2) else: print((L + (B - 1) + 1) // 2)
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
628,283
628,284
u006657459
python
p02823
n,a,b=map(int,input().split()) if (b-a)%2==0: print((b-a)//2) else: c=0 if n-a>b-1: c+=a-1 c+=1 c+=(b-1-1)//2 else: c+=n-b c+=1 c+=(n-a-1)//2 print(c)
n,a,b=map(int,input().split()) if (b-a)%2==0: print((b-a)//2) else: c=0 if n-a>b-1: c+=a-1 c+=1 c+=((b-1-c)//2) else: c+=n-b c+=1 c+=((n-a-c)//2) print(c)
[ "identifier.replace.add", "literal.replace.remove", "expression.operation.binary.change" ]
628,296
628,297
u780420070
python
p02823
N , A , B = map(int, input().split()) c = 0 if A%2 == B%2: print((B-A)//2) else: if N - B > A-1: c += N - B c += 1 c += (B-A-1)//2 print(c) else: c += A-1 c += 1 c += (B-A-1)//2 print(c)
N , A , B = map(int, input().split()) c = 0 if A%2 == B%2: print((B-A)//2) else: if N - B < A-1: c += N - B c += 1 c += (B-A-1)//2 print(c) else: c += A-1 c += 1 c += (B-A-1)//2 print(c)
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
628,304
628,305
u226849101
python
p02823
N , A , B = map(int, input().split()) c = 0 if A%2 == B%2: print((B-A)//2) else: if N - B > A: c += N - B c += 1 c += (B-A-1)//2 print(c) else: c += A-1 c += 1 c += (B-A-1)//2 print(c)
N , A , B = map(int, input().split()) c = 0 if A%2 == B%2: print((B-A)//2) else: if N - B < A-1: c += N - B c += 1 c += (B-A-1)//2 print(c) else: c += A-1 c += 1 c += (B-A-1)//2 print(c)
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
628,306
628,305
u226849101
python
p02823
N, A, B = map(int, input().split()) D = B - A ans = float('inf') if D % 2 == 0: ans = D//2 else: # 左端まで行く move = A - 1 L = 1 R = B - move D = R - L if D % 2 == 0: ans = min(ans, D//2 + move) else: ans = min(ans, D//2+1 + move) # 右端まで行く move = N - A L = A + m...
N, A, B = map(int, input().split()) D = B - A ans = float('inf') if D % 2 == 0: ans = D//2 else: # 左端まで行く move = A - 1 L = 1 R = B - move D = R - L if D % 2 == 0: ans = min(ans, D//2 + move) else: ans = min(ans, D//2+1 + move) # 右端まで行く move = N - B L = A + m...
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
628,310
628,311
u970308980
python
p02823
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ ''' #codeforces gi = lambda : list(map(int,input().split())) n, a, b = gi() if a > b: a, b = b, a if (abs(a - b) % 2): x = a b -= a x += (b - 1) // 2 y = n - b + 1 a += y y += (n - a) // 2 print(min(x, y)) else: print(abs(a - b) // 2)
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ ''' #codeforces gi = lambda : list(map(int,input().split())) n, a, b = gi() if a > b: a, b = b, a if (abs(a - b) % 2): x = a b -= a x += (b - 1) // 2 b += a y = n - b + 1 a += y y += (n - a) // 2 print(min(x, y)) else: print(abs(a - b) // 2)
[]
628,325
628,326
u909815117
python
p02823
n,a,b = map(int, input().split()) ans = b-a if ans%2==0: print(ans//2) else: if a-1 > n-b: a = a+ n-b+1 print((n-a)//2 + n-b) else: b = b-a+2 print((b-1)//2 +a-1)
n,a,b = map(int, input().split()) ans = b-a if ans%2==0: print(ans//2) else: if a-1 > n-b: a = a+ n-b+1 print((n-a)//2 + n-b+1) else: b = b-a+2 print((b-1)//2 +a-1)
[ "expression.operation.binary.add" ]
628,327
628,328
u117348081
python
p02823
N,A,B = map(int,input().split()) if (B-A) % 2 == 0: ans = (B - A) // 2 else: x = (B - A - 1)//2 + A y = (B - A - 1)//2 + N - B ans = min(x,y) print(ans)
N,A,B = map(int,input().split()) if (B-A) % 2 == 0: ans = (B - A) // 2 else: x = (B - A - 1)//2 + A y = (B - A - 1)//2 + N - B + 1 ans = min(x,y) print(ans)
[ "assignment.change" ]
628,346
628,347
u557494880
python
p02823
N, A, B=map(int, input().split()) if A%2==B%2: print((B-A)//2) else: print(min((A+B-1)//2, (B-A+1)//2))
N, A, B=map(int, input().split()) if A%2==B%2: print((B-A)//2) else: print(min((A+B-1)//2, N+(-B-A+1)//2))
[ "expression.operation.unary.add", "call.arguments.change" ]
628,348
628,349
u419877586
python
p02823
N, A, B = [int(i) for i in input().split()] if (B-A) % 2 == 0: print((B- A) // 2) else: if A - 1 <= N - B: print(A + (B - A) // 2) else: print(N - B + (B - A) // 2)
N, A, B = [int(i) for i in input().split()] if (B-A) % 2 == 0: print((B- A) // 2) else: if A - 1 <= N - B: print(A + (B - A) // 2) else: print(N - B + 1 + (B - A) // 2)
[ "expression.operation.binary.add" ]
628,352
628,353
u256281774
python
p02823
N, A, B = map(int, input().split()) if (B-A)%2 == 0: print((B-A)//2) else: if A-1 < (N-B): ans = A B -= A A = 1 ans += (B-A)//2 print(ans) else: ans = N - B + 1 B = N A += N-B+1 ans += (B-A)//2 print(ans)
N, A, B = map(int, input().split()) if (B-A)%2 == 0: print((B-A)//2) else: if A-1 < (N-B): ans = A B -= A A = 1 ans += (B-A)//2 print(ans) else: ans = N-B+1 A += N-B+1 B = N ans += (B-A)//2 print(ans)
[ "assignment.remove", "assignment.add" ]
628,354
628,355
u886747123
python
p02823
N, A, B = map(int, input().split()) if (B - A) % 2 == 0: print((B - A) // 2) else: lose = N - B loseThenMeet = (N - (A + lose)) // 2 win = A - 1 winThenMeet = ((B - win) - 1) // 2 print(min(lose + loseThenMeet, win + winThenMeet))
N, A, B = map(int, input().split()) if (B - A) % 2 == 0: print((B - A) // 2) else: lose = N - B + 1 loseThenMeet = (N - (A + lose)) // 2 win = A - 1 + 1 winThenMeet = ((B - win) - 1) // 2 print(min(lose + loseThenMeet, win + winThenMeet))
[ "assignment.change" ]
628,363
628,364
u183395797
python
p02823
n, a, b = map(int, input().split()) if (b - a) % 2 == 0: print((b - a) // 2) else: ans1 = a c = b - ans1 ans1 += (c - 1) // 2 ans2 = n-b c = a + ans2 ans2 += (n - c) // 2 print(min(ans1, ans2))
n, a, b = map(int, input().split()) if (b - a) % 2 == 0: print((b - a) // 2) else: ans1 = a c = b - ans1 ans1 += (c - 1) // 2 ans2 = n-b+1 c = a + ans2 ans2 += (n - c) // 2 print(min(ans1, ans2))
[ "assignment.change" ]
628,373
628,374
u768128363
python
p02823
import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline n, a, b = [int(item) for item in input().split()] ans = 10**20 diff = abs(a - b) if diff % 2 == 0: ans = diff // 2 print(ans) else: if a > b: a, b = b, a left = a left += (b - left) // 2 right = 2 * n - b + 1 right ...
import sys sys.setrecursionlimit(10**6) input = sys.stdin.readline n, a, b = [int(item) for item in input().split()] ans = 10**20 diff = abs(a - b) if diff % 2 == 0: ans = diff // 2 print(ans) else: if a > b: a, b = b, a left = a left += (b - left) // 2 right = n - b + 1 right += (...
[ "expression.operation.binary.remove" ]
628,379
628,380
u052499405
python
p02823
N,A,B=map(int,input().split()) if (B-A)%2==0: print((B-A)//2) else: print(min((B+A-1)//2,((2*N-B+1)//2)))
N,A,B=map(int,input().split()) if (B-A)%2==0: print((B-A)//2) else: print(min((B+A-1)//2,((2*N-B+1-A)//2)))
[ "expression.operation.binary.add" ]
628,394
628,395
u187516587
python
p02823
N, A, B = map(int, input().split()) if (B - A) & 1: res = (B - A - 1) // 2 + A A, B = 2 * N - B + 1, 2 * N - A + 1 res = min(res, (B - A - 1) // 2 + A) print(res) else: print((B - A) // 2)
N, A, B = map(int, input().split()) if (B - A) & 1: res = (B - A - 1) // 2 + A A, B = N - B + 1, N - A + 1 res = min(res, (B - A - 1) // 2 + A) print(res) else: print((B - A) // 2)
[ "expression.operation.binary.remove" ]
628,417
628,418
u732412551
python
p02823
N, A, B = map(int, input().split()) if (B - A) % 2 == 0: print ((B - A) // 2) exit() tmp1 = A b = B - A tmp1 += (B - 1) // 2 tmp2 = N - B a = A + tmp2 tmp2 += (N - a) // 2 print (min(tmp1, tmp2) + 1)
N, A, B = map(int, input().split()) if (B - A) % 2 == 0: print ((B - A) // 2) exit() tmp1 = A - 1 b = B - tmp1 tmp1 += (b - 1) // 2 tmp2 = N - B a = A + tmp2 tmp2 += (N - a) // 2 print (min(tmp1, tmp2) + 1)
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
628,428
628,429
u263830634
python
p02823
def main(): N, A, B = [int(i) for i in input().split()] diff = B - A if diff % 2 == 0: ans = diff // 2 else: ans = min(B - 1, N - A, (A - 1) + 1 + (diff - 1) // 2, (N - B) + 1 (diff - 1) // 2) print(ans) if __name__ == '__main__': main()
def main(): N, A, B = [int(i) for i in input().split()] diff = B - A if diff % 2 == 0: ans = diff // 2 else: ans = min(B - 1, N - A, (A - 1) + 1 + (diff - 1) // 2, (N - B) + 1 + (diff - 1) // 2) print(ans) if __name__ == '__main__': main()
[ "call.arguments.change" ]
628,432
628,433
u624689667
python
p02823
N, A, B = map(int, input().split()) if abs(A - B) % 2 == 0: print(abs(A - B) // 2) else: print(min(A-1, B-1) + 1 + (B-A-1)//2)
N, A, B = map(int, input().split()) if abs(A - B) % 2 == 0: print(abs(A - B) // 2) else: print(min(A-1, N-B) + 1 + (B-A-1)//2)
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change", "identifier.replace.add", "literal.replace.remove" ]
628,464
628,465
u317713173
python
p02823
n,a,b=map(int,input().split()) if (b-a)%2==0: print((b-a)//2) else: print(min(a-1+(b-a)//2,n-b+(b-a)//2))
n,a,b=map(int,input().split()) if (b-a)%2==0: print((b-a)//2) else: print(min(a-1+(b-a+1)//2,n-b+(b-a+1)//2))
[ "expression.operation.binary.add" ]
628,468
628,469
u670180528
python
p02823
N,A,B= map(int,input().split()) m = abs(B-A) if m%2==0: ans = m//2 else: ans1 = N-B+1 A1 = A+N-B+1 ans1 += (N-A1)//2 ans2 = A-1+1 B2 = B-A-2 ans2 += (B2-1)//2 ans = min(ans1,ans2) print(ans)
N,A,B= map(int,input().split()) m = abs(B-A) if m%2==0: ans = m//2 else: ans1 = N-B+1 A1 = A+N-B+1 ans1 += (N-A1)//2 ans2 = A B2 = B-A ans2 += (B2-1)//2 ans = min(ans1,ans2) print(ans)
[ "expression.operation.binary.remove" ]
628,480
628,481
u698176039
python
p02823
n,a,b = map(int,input().split()) if abs(a-b)%2 == 0: print(abs(a-b)//2) else: print(min((a+b+1)//2,(n-a+n-b+1)//2))
n,a,b = map(int,input().split()) if abs(a-b)%2 == 0: print(abs(a-b)//2) else: print(min((a+b-1)//2,(n-a+n-b+1)//2))
[ "misc.opposites", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
628,488
628,489
u667024514
python
p02824
n,m,v,p = map(int, input().split()) a = list(map(int, input().split())) a.sort() def solve(ind): if a[ind]+m < a[-p]: return False thr = a[ind] + m votes=[] for i in range(n): if i<=ind or i>n-p: votes.append(m) else: votes.append(thr-a[i]) sm = sum(v...
n,m,v,p = map(int, input().split()) a = list(map(int, input().split())) a.sort() def solve(ind): if a[ind]+m < a[-p]: return False thr = a[ind] + m votes=[] for i in range(n): if i<=ind or i>n-p: votes.append(m) else: votes.append(thr-a[i]) sm = sum(v...
[ "assignment.value.change", "expression.operation.unary.add" ]
628,540
628,541
u358254559
python
p02824
import sys def input(): return sys.stdin.readline().strip() def mapint(): return map(int, input().split()) sys.setrecursionlimit(10**9) N, M, V, P = mapint() As = list(mapint()) As.sort(reverse=True) threshold = As[P-1] l, r = P, N while l+1<r: half = (l+r)//2 a = As[half]+M if a<threshold: r = ha...
import sys def input(): return sys.stdin.readline().strip() def mapint(): return map(int, input().split()) sys.setrecursionlimit(10**9) N, M, V, P = mapint() As = list(mapint()) As.sort(reverse=True) threshold = As[P-1] l, r = P-1, N while l+1<r: half = (l+r)//2 a = As[half]+M if a<threshold: r = ...
[ "assignment.change" ]
628,545
628,546
u054514819
python
p02824
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1,...
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1,...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "expression.operation.binary.remove" ]
628,547
628,548
u145231176
python
p02824
from bisect import bisect_left,bisect_right N,M,V,P = map(int,input().split()) A = sorted(list(map(int,input().split()))) low = -1 high = A[-1]+M while high-low>1: mid = (low+high)//2 indL = bisect_left(A,mid-M) indR = bisect_right(A,mid) if indL>N-P: high = mid continue if indR<N-P+...
from bisect import bisect_left,bisect_right N,M,V,P = map(int,input().split()) A = sorted(list(map(int,input().split()))) low = -1 high = A[-1]+M while high-low>1: mid = (low+high)//2 indL = bisect_left(A,mid-M) indR = bisect_right(A,mid) if indL>N-P: high = mid continue if indR<N-P+...
[ "control_flow.break.remove" ]
628,554
628,555
u644907318
python
p02824
def is_ok(index): s=0 for i in range(p,index): s+=a[index]+m-a[i] return s+m*(n-index+p-1)>=m*v and a[index]+m>=a[p-1] def binary_search(a): ok=-1 ng=len(a) while abs(ng-ok)>1: mid=(ng+ok)//2 if is_ok(mid):ok=mid else:ng=mid return ok+1 n,m,v,p=map(int,input().split()) a=sorted(list(map(in...
def is_ok(index): s=0 for i in range(p-1,index): s+=a[index]+m-a[i] return s+m*(n-index+p-1)>=m*v and a[index]+m>=a[p-1] def binary_search(a): ok=-1 ng=len(a) while abs(ng-ok)>1: mid=(ng+ok)//2 if is_ok(mid):ok=mid else:ng=mid return ok+1 n,m,v,p=map(int,input().split()) a=sorted(list(map(...
[ "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.add" ]
628,571
628,572
u730769327
python
p02824
def is_ok(index): s=0 for i in range(p,index): s+=a[index]+m-a[i] return s+m*(n-index+p-1)>=m*v and a[index]+m>=a[p] def binary_search(a): ok=-1 ng=len(a) while abs(ng-ok)>1: mid=(ng+ok)//2 if is_ok(mid):ok=mid else:ng=mid return ok+1 n,m,v,p=map(int,input().split()) a=sorted(list(map(int,...
def is_ok(index): s=0 for i in range(p-1,index): s+=a[index]+m-a[i] return s+m*(n-index+p-1)>=m*v and a[index]+m>=a[p-1] def binary_search(a): ok=-1 ng=len(a) while abs(ng-ok)>1: mid=(ng+ok)//2 if is_ok(mid):ok=mid else:ng=mid return ok+1 n,m,v,p=map(int,input().split()) a=sorted(list(map(...
[ "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.add" ]
628,573
628,572
u730769327
python
p02824
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse = True) ans = p border = a[p-1] to_border = 0 for i in range(p,n): new_border = a[i] + m if new_border < border: print(ans) exit() possible_votes = 0 possible_votes += (p+n-i-1)*m possible_votes += t...
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse = True) ans = p border = a[p-1] to_border = 0 for i in range(p,n): new_border = a[i] + m if new_border < border: print(ans) exit() possible_votes = 0 possible_votes += (n+p-i-1)*m possible_votes += t...
[ "expression.operation.binary.remove" ]
628,574
628,575
u201928947
python
p02824
n, m, v, p = map(int, input().split()) alst = list(map(int, input().split())) alst.sort(reverse = True) left = p - 1 right = n while right - left > 1: pos = (left + right) // 2 if alst[pos] + m < alst[p - 1]: right = pos continue cnt = (p - 1) * m base = alst[pos] + m for i in range(...
n, m, v, p = map(int, input().split()) alst = list(map(int, input().split())) alst.sort(reverse = True) left = p - 1 right = n while right - left > 1: pos = (left + right) // 2 if alst[pos] + m < alst[p - 1]: right = pos continue cnt = (p - 1) * m base = alst[pos] + m for i in range(...
[ "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.add" ]
628,581
628,582
u745514010
python
p02824
#!/usr/bin python3 # -*- coding: utf-8 -*- n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) def f(x): if x < p: return True if a[p-1] > a[x] + m: return False else: res = m * v res -= m * (n-x) res -= m * (p-1) ...
#!/usr/bin python3 # -*- coding: utf-8 -*- n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) def f(x): if x < p: return True if a[p-1] > a[x] + m: return False else: res = m * v res -= m * (n-x) res -= m * (p-1) ...
[ "expression.operator.compare.change", "function.return_value.change" ]
628,583
628,584
u113971909
python
p02824
#!/usr/bin python3 # -*- coding: utf-8 -*- n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) def f(x): if x < p: return True if a[p-1] > a[x] + m: return False else: res = m * v res -= m * (n-x) res -= m * (p-1) ...
#!/usr/bin python3 # -*- coding: utf-8 -*- n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse = True) def f(x): if x < p: return True if a[p-1] > a[x] + m: return False else: res = m * v res -= m * (n-x) res -= m * (p-1) ...
[ "misc.opposites", "expression.operator.compare.change", "function.return_value.change" ]
628,585
628,584
u113971909
python
p02824
N, M, V, P = map(int,input().split()) A = list(map(int,input().split())) A.sort(reverse = True) def solve(n): if n < P: return True if A[n-1] > A[n] + M: return False cnt = M * (P - 1 + N - n) for i in range(P-1,n): cnt += A[n] + M - A[i] return cnt >= M * V l...
N, M, V, P = map(int,input().split()) A = list(map(int,input().split())) A.sort(reverse = True) def solve(n): if n < P: return True if A[P-1] > A[n] + M: return False cnt = M * (P - 1 + N - n) for i in range(P-1,n): cnt += max(0, A[n] + M - A[i]) return ...
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change", "call.add", "call.arguments.change" ]
628,638
628,639
u189479417
python
p02824
N, M, V, P = map(int,input().split()) A = list(map(int,input().split())) A.sort(reverse = True) def solve(n): if n < P: return True if A[n-1] > A[n] + M: return False cnt = M * (P - 1 + N - n) for i in range(P-1,n): cnt += max(0, A[n] + M - A[i]) return cnt >= M *...
N, M, V, P = map(int,input().split()) A = list(map(int,input().split())) A.sort(reverse = True) def solve(n): if n < P: return True if A[P-1] > A[n] + M: return False cnt = M * (P - 1 + N - n) for i in range(P-1,n): cnt += max(0, A[n] + M - A[i]) return ...
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
628,640
628,639
u189479417
python
p02824
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) higher = a[p-1] for i in range(p,n): if(a[i] == a[i-1]): higher += a[i] continue if(a[p-1]- a[i] > v): print(i) exit() if(higher - a[i]*(i-p+1) > min(n-v,i-p+1)*m): print(i)...
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) higher = a[p-1] for i in range(p,n): if(a[i] == a[i-1]): higher += a[i] continue if(a[p-1]- a[i] > m): print(i) exit() if(higher - a[i]*(i-p+1) > min(n-v,i-p+1)*m): print(i)...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
628,654
628,655
u490642448
python
p02824
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) higher = a[p-1] for i in range(p,n): if(a[i] == a[i-1]): higher += a[i] continue if(a[p-1]- a[i] > v): print(i) exit() if(higher - a[i]*(i-p+1) > min(n-v,p-1)*m): print(i) ...
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) higher = a[p-1] for i in range(p,n): if(a[i] == a[i-1]): higher += a[i] continue if(a[p-1]- a[i] > m): print(i) exit() if(higher - a[i]*(i-p+1) > min(n-v,i-p+1)*m): print(i)...
[ "identifier.change", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
628,656
628,655
u490642448
python
p02824
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) higher = a[p-1] for i in range(p,n): if(a[i] == a[p-1]): higher += a[i] continue if(a[p-1]- a[i] > v): print(i) exit() if(higher - a[i]*(i-p+1) > min(n-v,p-1)*m): print(i) ...
n,m,v,p = map(int,input().split()) a = list(map(int,input().split())) a.sort(reverse=True) higher = a[p-1] for i in range(p,n): if(a[i] == a[i-1]): higher += a[i] continue if(a[p-1]- a[i] > m): print(i) exit() if(higher - a[i]*(i-p+1) > min(n-v,i-p+1)*m): print(i)...
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
628,657
628,655
u490642448
python
p02824
# 上からx問目を選ぶことができるか二分探索 # x <= Pであれば必ず選べる # A_x + M < A_Pであれば必ず選べない # それ以外の場合 # A_xには必ず投票するのでA_x + Mが基準点 # A_xがP位である必要がある # 上位P - 1位までにはM票投票して良い # P + 1位以下に対しては、A_x + Mまでは投票して良い # この投票して良い数がM * Vを上回ればOK import sys readline = sys.stdin.readline N,M,V,P = map(int,readline().split()) A = sorted(list(map(int,readline().sp...
# 上からx問目を選ぶことができるか二分探索 # x <= Pであれば必ず選べる # A_x + M < A_Pであれば必ず選べない # それ以外の場合 # A_xには必ず投票するのでA_x + Mが基準点 # A_xがP位である必要がある # 上位P - 1位までにはM票投票して良い # P + 1位以下に対しては、A_x + Mまでは投票して良い # この投票して良い数がM * Vを上回ればOK import sys readline = sys.stdin.readline N,M,V,P = map(int,readline().split()) A = sorted(list(map(int,readline().sp...
[ "control_flow.branch.if.condition.change", "assignment.variable.change", "identifier.change", "assignment.value.change", "call.arguments.change" ]
628,664
628,665
u936985471
python
p02824
# 上からx問目を選ぶことができるか二分探索 # x <= Pであれば必ず選べる # A_x + M < A_Pであれば必ず選べない # それ以外の場合 # A_xには必ず投票するのでA_x + Mが基準点 # A_xがP位である必要がある # 上位P - 1位までにはM票投票して良い # P + 1位以下に対しては、A_x + Mまでは投票して良い # この投票して良い数がM * Vを上回ればOK import sys readline = sys.stdin.readline N,M,V,P = map(int,readline().split()) A = sorted(list(map(int,readline().sp...
# 上からx問目を選ぶことができるか二分探索 # x <= Pであれば必ず選べる # A_x + M < A_Pであれば必ず選べない # それ以外の場合 # A_xには必ず投票するのでA_x + Mが基準点 # A_xがP位である必要がある # 上位P - 1位までにはM票投票して良い # P + 1位以下に対しては、A_x + Mまでは投票して良い # この投票して良い数がM * Vを上回ればOK import sys readline = sys.stdin.readline N,M,V,P = map(int,readline().split()) A = sorted(list(map(int,readline().sp...
[ "control_flow.branch.if.condition.change", "assignment.variable.change", "identifier.change", "assignment.value.change", "call.arguments.change" ]
628,664
628,666
u936985471
python
p02824
import bisect n,m,v,p = map(int, input().split()) a = list(map(int, input().split())) a.sort() #print(a) if (v<=p): limit = a[n-p] if (a[n-p] <= m): print(n) else: x = bisect.bisect_left(a,a[n-p]-m) print(n-x) else: limit = a[n-p] #print(1,limit) wa = [0]*n wa[0] = a[...
import bisect n,m,v,p = map(int, input().split()) a = list(map(int, input().split())) a.sort() #print(a) if (v<=p): limit = a[n-p] if (a[n-p] <= m): print(n) else: x = bisect.bisect_left(a,a[n-p]-m) print(n-x) else: limit = a[n-p] #print(1,limit) wa = [0]*n wa[0] = a[...
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove" ]
628,682
628,683
u262597910
python
p02824
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline n,m,v,p = map(int,readline().split()) a = [int(i) for i in readline().split()] a.sort(reverse=True) ans = p v -= (p-1) g = a[p-1] L = 1 use = m-g if v > 0: for i in range(p,n): mar = g-a[i] V = v-(n-1-i) if mar > m: break...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline n,m,v,p = map(int,readline().split()) a = [int(i) for i in readline().split()] a.sort(reverse=True) ans = p v -= (p-1) g = a[p-1] L = 1 use = m-g for i in range(p,n): mar = g-a[i] V = v-(n-1-i) if mar > m: break if V <= 1: if...
[]
628,686
628,687
u075595666
python
p02824
n, m, v, p = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) ok = p - 1 ng = n while ok - ng > 1: mid = (ok + ng) // 2 if A[mid] + m < A[p - 1]: ng = mid continue used = m * p for i in range(p - 1, n): if i == mid: continue used += min(m, max(0, A[mid...
n, m, v, p = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) ok = p - 1 ng = n while abs(ok - ng) > 1: mid = (ok + ng) // 2 if A[mid] + m < A[p - 1]: ng = mid continue used = m * p for i in range(p - 1, n): if i != mid: used += min(m, max(0, A[mid] + m - A...
[ "control_flow.loop.condition.change", "call.add", "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
628,695
628,696
u802963389
python
p02824
n, m, v, p = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) ok = p - 1 ng = n while ok - ng > 1: mid = (ok + ng) // 2 if A[mid] + m < A[p - 1]: ng = mid continue used = m * p for i in range(p - 1, n): if i == mid: continue used += min(m, max(0, A[mid...
n, m, v, p = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) ok = p - 1 ng = n while abs(ok - ng) > 1: mid = (ok + ng) // 2 if A[mid] + m < A[p - 1]: ng = mid continue used = m * p for i in range(p - 1, n): if i == mid: continue used += min(m, max(0, ...
[ "control_flow.loop.condition.change", "call.add" ]
628,695
628,697
u802963389
python
p02824
import bisect n, m, v, p = map(int, input().split()) ls = list(map(int, input().split())) ls.sort() total=m*v for i in range(min(v-1,p-1)): ls[-i-1]+=m total-=m ac = [0]*n for i in range(n-1): ac[i+1] = ac[i]+(ls[i+1]-ls[i])*(i+1) ans=p for i in range(n-p): idx=bisect.bisect_right(ls,ls[i]+m) if ...
import bisect n, m, v, p = map(int, input().split()) ls = list(map(int, input().split())) ls.sort() total=m*v for i in range(min(v-1,p-1)): ls[-i-1]+=m total-=m ac = [0]*n for i in range(n-1): ac[i+1] = ac[i]+(ls[i+1]-ls[i])*(i+1) ans=p for i in range(n-p): idx=bisect.bisect_right(ls,ls[i]+m) if ...
[ "assignment.variable.change", "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "control_flow.branch.if.add" ]
628,698
628,699
u802234509
python
p02824
#!/usr/bin/env python3 import sys, math, itertools, collections, bisect input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') inf = float('inf') ;mod = 10**9+7 mans = inf ;ans = 0 ;count = 0 ;pro = 1 n,m,v,p=map(int,input().split()) A=list(map(int,input().split())) A.sort() # print(A) B=A[:] A.append(in...
#!/usr/bin/env python3 import sys, math, itertools, collections, bisect input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') inf = float('inf') ;mod = 10**9+7 mans = inf ;ans = 0 ;count = 0 ;pro = 1 n,m,v,p=map(int,input().split()) A=list(map(int,input().split())) A.sort() # print(A) B=A[:] A.append(in...
[ "control_flow.branch.if.condition.change" ]
628,755
628,756
u716530146
python
p02824
# B import numpy as np N, M, V, P = map(int, input().split()) A = np.array(input().split(), dtype=int) A = np.sort(A)[::-1] # X(1-origin)が再録される可能性があるか def f(X): # M人が, Pに票を入れず、Xに全振りして可能性がないなら終了 if (A[P-1] > A[X-1] + M): # print("C1") return False # M人がV2回投票を行う V2 = V - (P-1) - 1 - (N-...
# B import numpy as np N, M, V, P = map(int, input().split()) A = np.array(input().split(), dtype=int) A = np.sort(A)[::-1] # X(1-origin)が再録される可能性があるか def f(X): # M人が, Pに票を入れず、Xに全振りして可能性がないなら終了 if (A[P-1] > A[X-1] + M): # print("C1") return False # M人がV2回投票を行う V2 = V - (P-1) - 1 - (N-...
[ "assignment.change" ]
628,779
628,780
u663093503
python
p02824
n, m, v, p = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) lim_A = A[p-1] res_A = A[p:] res_n = len(res_A) for i in range(res_n): res_A[i] = lim_A - res_A[i] ans = lim_A cnt = 0 for i in range(res_n): if m >= res_A[i] and m * max(v-p-(res_n-i-1), 0) <= cnt + (m-res_A[i])...
n, m, v, p = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) lim_A = A[p-1] res_A = A[p:] res_n = len(res_A) for i in range(res_n): res_A[i] = lim_A - res_A[i] ans = p cnt = 0 for i in range(res_n): if m >= res_A[i] and m * max(v-p-(res_n-i-1), 0) <= cnt + (m-res_A[i])*...
[ "assignment.value.change", "identifier.change" ]
628,799
628,800
u328364772
python
p02824
#!/usr/bin/env python3 import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collection...
#!/usr/bin/env python3 import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collection...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "misc.off_by_one" ]
628,805
628,806
u191874006
python
p02824
import sys import math import numpy as np stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] n, m, v, p = na() a = na() a.sort(reverse=True) a...
import sys import math import numpy as np stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] n, m, v, p = na() a = na() a.sort(reverse=True) a...
[ "expression.operation.binary.remove" ]
628,809
628,810
u524870111
python
p02824
import sys import math import numpy as np stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] n, m, v, p = na() a = na() a.sort(reverse=True) a...
import sys import math import numpy as np stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] n, m, v, p = na() a = na() a.sort(reverse=True) a...
[ "call.remove" ]
628,811
628,812
u524870111
python
p02824
import sys import math import numpy as np stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] n, m, v, p = na() a = na() a.sort(reverse=True) a...
import sys import math import numpy as np stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] n, m, v, p = na() a = na() a.sort(reverse=True) a...
[ "assignment.value.change", "identifier.replace.remove", "literal.replace.add", "expression.operation.binary.change", "expression.operation.binary.remove" ]
628,809
628,812
u524870111
python
p02824
import sys input = sys.stdin.readline N, M, V, P = map(int, input().split()) a = list(map(int, input().split())) a.sort() ng = -1 ok = N - P #print(a) def check(x): vs = M * V p = N for i in range(N): if a[i] > a[x] + M: p = i - 1 break #print(x, vs, p) if p < N - P: return False #print(x, ...
import sys input = sys.stdin.readline N, M, V, P = map(int, input().split()) a = list(map(int, input().split())) a.sort() ng = -1 ok = N - P #print(a) def check(x): vs = M * V p = N for i in range(N): if a[i] > a[x] + M: p = i - 1 break #print(x, vs, p) if p < N - P: return False #print(x, ...
[ "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.add" ]
628,815
628,816
u141610915
python
p02824
import sys input = sys.stdin.readline N, M, V, P = map(int, input().split()) a = list(map(int, input().split())) a.sort() ng = -1 ok = N - P #print(a) def check(x): vs = M * V p = N for i in range(N): if a[i] > a[x] + M: p = i break #print(x, vs, p) if p < N - P: return False #print(x, vs) ...
import sys input = sys.stdin.readline N, M, V, P = map(int, input().split()) a = list(map(int, input().split())) a.sort() ng = -1 ok = N - P #print(a) def check(x): vs = M * V p = N for i in range(N): if a[i] > a[x] + M: p = i - 1 break #print(x, vs, p) if p < N - P: return False #print(x, ...
[ "assignment.change", "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.add" ]
628,817
628,816
u141610915
python
p02824
n,m,v,p=map(int,input().split()) A=sorted(list(map(int,input().split())))[-p::-1] s=0;p-=1 for u,a in enumerate(A): if a>=A[0]-m and u*a+m*n-m*v>=s:s+=a;p+=1 print(p)
n,m,v,p=map(int,input().split()) A=sorted(list(map(int,input().split())))[-p::-1] s=0;p-=1 for u,a in enumerate(A): if a<A[0]-m or u*a+m*n-m*v<s:break s+=a;p+=1 print(p)
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "control_flow.break.add" ]
628,820
628,821
u956530786
python
p02824
# A[i]が採用されるとき、A[i-1]も採用されるという単調性があるので二分探索で解く N, M, V, P = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) capacity = M * (N-V) def isOK(i): ai = A[i] # 基準となる値 s = 0 # 0~P-2番目のP-1問とi番目とi番目以降には全員が投票しても構わない # P-1番目からi-1番目までについて考える必要がある for j in range(P-i, i): ...
# A[i]が採用されるとき、A[i-1]も採用されるという単調性があるので二分探索で解く N, M, V, P = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) capacity = M * (N-V) def isOK(i): ai = A[i] # 基準となる値 s = 0 # 0~P-2番目のP-1問とi番目とi番目以降には全員が投票しても構わない # P-1番目からi-1番目までについて考える必要がある for j in range(P-1, i): ...
[ "identifier.replace.remove", "literal.replace.add", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.remove" ]
628,824
628,825
u708255304
python
p02824
# A[i]が採用されるとき、A[i-1]も採用されるという単調性があるので二分探索で解く N, M, V, P = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) capacity = M * (N-V) def isOK(i): ai = A[i] # 基準となる値 s = 0 # 0~P-2番目のP-1問とi番目とi番目以降には全員が投票しても構わない # P-1番目からi-1番目までについて考える必要がある for j in range(P-i, i): ...
# A[i]が採用されるとき、A[i-1]も採用されるという単調性があるので二分探索で解く N, M, V, P = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) capacity = M * (N-V) def isOK(i): ai = A[i] # 基準となる値 s = 0 # 0~P-2番目のP-1問とi番目とi番目以降には全員が投票しても構わない # P-1番目からi-1番目までについて考える必要がある for j in range(P-1, i): ...
[ "identifier.replace.remove", "literal.replace.add", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change" ]
628,824
628,826
u708255304
python
p02824
from itertools import * n, m, v, p, *a = map(int, open(0).read().split()) a.sort(reverse=True) acc = list(accumulate(a)) + [0] ok, ng = p - 1, n while ng - ok > 1: mid = (ok + ng) // 2 if a[mid] + m > a[p - 1] and (a[mid] + m) * (mid - p + 1) - (acc[mid - 1] - acc[p - 2]) >= m * ( v - (p - 1) - (n - mid)): ok = ...
from itertools import * n,m,v,p,*a=map(int,open(0).read().split()) a.sort(reverse=True) acc=list(accumulate(a))+[0] ok,ng=p-1,n while ng-ok>1: mid=(ok+ng)//2 if a[mid]+m>=a[p-1] and (a[mid]+m)*(mid-p+1)-(acc[mid-1]-acc[p-2])>=m*(v-(p-1)-(n-mid)): ok=mid else: ng=mid print(ok+1)
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
628,856
628,857
u670180528
python
p02824
n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) def can_be_used(x): # x: 0-index if x < p: return True if a[x] + m < a[p-1]: return False vote_max = (p - 1 + n - x) * m for i in range(p-1, x): vote_max += a[x] + m - a[i] ...
n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) def can_be_used(x): # x: 0-index if x < p: return True if a[x] + m < a[p-1]: return False vote_max = (p - 1 + n - x) * m for i in range(p-1, x): vote_max += a[x] + m - a[i] ...
[ "expression.operation.binary.remove" ]
628,865
628,866
u893063840
python
p02824
N, M, V, P = map(int, input().split()) As = list(map(int, input().split())) As.sort(reverse=True) scoreP = As[P-1] def isOK(k): if k < P or As[k] == scoreP: return True scoreK = As[k] + M if scoreK < scoreP: return False rest = M*(V-1) rest -= M*(P-1) if rest <= 0: r...
N, M, V, P = map(int, input().split()) As = list(map(int, input().split())) As.sort(reverse=True) scoreP = As[P-1] def isOK(k): if k < P or As[k] == scoreP: return True scoreK = As[k] + M if scoreK < scoreP: return False rest = M*(V-1) rest -= M*(P-1) if rest <= 0: r...
[ "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.add" ]
628,878
628,879
u297574184
python
p02824
import sys from bisect import * sys.setrecursionlimit(10**9) INF=10**18 def input(): return sys.stdin.readline().rstrip() def main(): def nibutan(ok,ng): while abs(ok-ng) > 1: mid = (ok + ng) // 2 if solve(mid): ok = mid else: ng = mid...
import sys from bisect import * sys.setrecursionlimit(10**9) INF=10**18 def input(): return sys.stdin.readline().rstrip() def main(): def nibutan(ok,ng): while abs(ok-ng) > 1: mid = (ok + ng) // 2 if solve(mid): ok = mid else: ng = mid...
[ "call.add", "call.arguments.add" ]
628,904
628,905
u714642969
python
p02824
n,m,v,p = map(int, input().split()) a = sorted(list(map(int, input().split())), reverse=True) # せっかくなのであとでmarginを前計算してm*v以上をbisect def isOK(x): border = a[x-1] if border + m < a[p-1]: return False elif x <= p: return True else: margin = m * n for i in range(p-1,x-1): margin -= a[i] - bord...
n,m,v,p = map(int, input().split()) a = sorted(list(map(int, input().split())), reverse=True) # せっかくなのであとでmarginを前計算してm*v以上をbisect def isOK(x): border = a[x-1] if border + m < a[p-1]: return False elif x <= p: return True else: margin = m * n for i in range(p-1,x-1): margin -= a[i] - bord...
[ "assignment.change" ]
628,922
628,923
u102960641
python
p02824
N,M,V,P = map(int,input().split()) import numpy as np A = list(map(int,input().split())) A = np.array(sorted(A,reverse=True)) ans = P x = A[P-1] y = N-1 for i in range(P,N): a = A[i] if x==a: ans+=1 else: y=i break z = sum(A[P-1:y]) for i in range(y,N): a = A[i] d = a+M if x<=d: b = N-i...
N,M,V,P = map(int,input().split()) import numpy as np A = list(map(int,input().split())) A = np.array(sorted(A,reverse=True)) ans = P x = A[P-1] y = N for i in range(P,N): a = A[i] if x==a: ans+=1 else: y=i break z = sum(A[P-1:y]) for i in range(y,N): a = A[i] d = a+M if x<=d: b = N-i+P-1 ...
[ "expression.operation.binary.remove" ]
628,937
628,938
u268554510
python
p02824
N,M,V,P = map(int,input().split()) import numpy as np A = list(map(int,input().split())) A = np.array(sorted(A,reverse=True)) ans = P x = A[P-1] for i in range(P,N): a = A[i] if x==a: ans+=1 else: y=i break z = sum(A[P-1:y]) for i in range(y,N): a = A[i] d = a+M if x<=d: b = N-i+P-1 ...
N,M,V,P = map(int,input().split()) import numpy as np A = list(map(int,input().split())) A = np.array(sorted(A,reverse=True)) ans = P x = A[P-1] y = N for i in range(P,N): a = A[i] if x==a: ans+=1 else: y=i break z = sum(A[P-1:y]) for i in range(y,N): a = A[i] d = a+M if x<=d: b = N-i+P-1 ...
[ "assignment.add" ]
628,939
628,938
u268554510
python
p02824
import sys def I(): return int(sys.stdin.readline()) def LI(): return [int(x) for x in sys.stdin.readline().split()] N,M,V,P = LI() A = LI() A.sort() def check(x): if (N-x)<=P: return True x_score = A[x] + M if (V-x-P) <= 0: return(A[N-P]<=x_score) total_v = (V-x-P)*M if(A[N-P]>x...
import sys def I(): return int(sys.stdin.readline()) def LI(): return [int(x) for x in sys.stdin.readline().split()] N,M,V,P = LI() A = LI() A.sort() def check(x): if (N-x)<=P: return True x_score = A[x] + M if (V-x-P) <= 0: return(A[N-P]<=x_score) total_v = (V-x-P)*M if(A[N-P]>x...
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "control_flow.return.remove", "control_flow.return.add" ]
628,962
628,963
u118642796
python
p02824
from bisect import bisect_left n,m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort() if v >= p: l, r = -1, n - p - 1 while r - l > 1: flg = 0 med = (l + r) // 2 t = (v - p) * m for i in range(n - p + 1): if a[med] + m < a[i]: ...
from bisect import bisect_left n,m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort() if v >= p: l, r = -1, n - p while r - l > 1: flg = 0 med = (l + r) // 2 t = (v - p) * m for i in range(n - p + 1): if a[med] + m < a[i]: f...
[ "expression.operation.binary.remove", "call.remove" ]
628,977
628,978
u143509139
python
p02824
from bisect import bisect_left n,m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort() if v >= p: l, r = -1, n - p - 1 while r - l > 1: flg = 0 med = (l + r) // 2 t = max(v - p, 0) * m for i in range(n - p + 1): if a[med] + m < a[i]: ...
from bisect import bisect_left n,m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort() if v >= p: l, r = -1, n - p while r - l > 1: flg = 0 med = (l + r) // 2 t = (v - p) * m for i in range(n - p + 1): if a[med] + m < a[i]: f...
[ "expression.operation.binary.remove", "call.arguments.change" ]
628,979
628,978
u143509139
python
p02824
def main(): n, m, v, p = list(map(int, input().split())) a = sorted(list(map(int, input().split()))) # print(a) def value(i): if i+p >= n: return True if a[n-p] > a[i]+m: return False b = list(reversed([a[i]+m-j for j in a[:i] + a[i+1:n]]))[p-2:] ...
def main(): n, m, v, p = list(map(int, input().split())) a = sorted(list(map(int, input().split()))) # print(a) def value(i): if i+p >= n: return True if a[n-p] > a[i]+m: return False b = list(reversed([a[i]+m-j for j in a[:i] + a[i+1:n]]))[p-1:] ...
[ "literal.number.integer.change", "assignment.value.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "misc.opposites", "function.return_value.change" ]
628,984
628,986
u532966492
python
p02824
N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A = list(reversed(sorted(A))) def ok(x): if x + M < A[P]: return False sc = M * V for a in A[:P-1]: sc = sc - M for a in A[P-1:]: sc = sc - min(M, x + M - a) return sc <= 0 l, r = -1, N while r - l >...
N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A = list(reversed(sorted(A))) def ok(x): if x + M < A[P-1]: return False sc = M * V for a in A[:P-1]: sc = sc - M for a in A[P-1:]: sc = sc - min(M, x + M - a) return sc <= 0 l, r = -1, N while r - l...
[ "control_flow.branch.if.condition.change" ]
628,987
628,988
u382423941
python
p02824
N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A = list(reversed(sorted(A))) def ok(x): if x + M < A[P]: return False sc = M * V for a in A[:P-1]: sc = sc - M for a in A[P:]: sc = sc - min(M, x + M - a) return sc <= 0 l, r = -1, N while r - l > 1...
N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A = list(reversed(sorted(A))) def ok(x): if x + M < A[P-1]: return False sc = M * V for a in A[:P-1]: sc = sc - M for a in A[P-1:]: sc = sc - min(M, x + M - a) return sc <= 0 l, r = -1, N while r - l...
[ "control_flow.branch.if.condition.change" ]
628,989
628,988
u382423941
python
p02824
def check(i, N, M, V, P, A): K = N - V tot = sum(A[(P-1):i]) - A[i]*(i-(P-1)) if K*M >= tot and (A[P-1]-A[i])<=N: return True else: return False N, M, V, P = map(int,input().split()) A = [int(i) for i in input().split()] A.sort(reverse=True) start = P end = N-1 if check(end, N, M, V, P...
def check(i, N, M, V, P, A): K = N - V tot = sum(A[(P-1):i]) - A[i]*(i-(P-1)) if K*M >= tot and (A[P-1]-A[i])<=M: return True else: return False N, M, V, P = map(int,input().split()) A = [int(i) for i in input().split()] A.sort(reverse=True) start = P end = N-1 if check(end, N, M, V, P...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
629,009
629,010
u749359783
python
p02824
n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort() a = a[::-1] s = [0] * p for i in range(p, n + 1): s.append(s[-1] + a[i - 1]) s = s[1:] ans = 0 for i in range(1, n + 1): if i <= p: ans += 1 else: if v - 1 <= p - 1: if a[i - 1] + m >= a[p - 1]...
n, m, v, p = map(int, input().split()) a = list(map(int, input().split())) a.sort() a = a[::-1] s = [0] * p for i in range(p, n + 1): s.append(s[-1] + a[i - 1]) s = s[1:] ans = 0 for i in range(1, n + 1): if i <= p: ans += 1 else: if v - 1 <= p - 1: if a[i - 1] + m >= a[p - 1]...
[ "literal.number.integer.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
629,013
629,014
u470542271
python
p02824
from bisect import bisect_right as br n,m,v,p=map(int,input().split()) a=sorted(list(map(int,input().split()))) l,r=n,0 while l-r>1: t=(l+r)//2 s=a[t]+m w=a[:] k=m*(v-1) for i in range(n): if i!=t: if i<t: c=min(k,m) k-=c w[i]+=c ...
from bisect import bisect_right as br n,m,v,p=map(int,input().split()) a=sorted(list(map(int,input().split()))) l,r=n,-1 while l-r>1: t=(l+r)//2 s=a[t]+m w=a[:] k=m*(v-1) for i in range(n): if i!=t: if i<t: c=min(k,m) k-=c w[i]+=c ...
[ "assignment.value.change", "expression.operation.unary.add" ]
629,041
629,042
u619819312
python
p02824
N,M,V,P = map(int,input().split()) A = list(map(int,input().split())) A = sorted(A) S = sum(A) for i in range(P-1): x = A.pop() S -= x print(A) total_score = M*(V-P+1) kazu = N - P + 1 for i in range(N-P+1): a = A.pop(0) total_score -= M S -= a kazu -= 1 T = (M+a)*kazu - S if i == N - P:...
N,M,V,P = map(int,input().split()) A = list(map(int,input().split())) A = sorted(A) S = sum(A) for i in range(P-1): x = A.pop() S -= x total_score = M*(V-P+1) kazu = N - P + 1 for i in range(N-P+1): a = A.pop(0) total_score -= M S -= a kazu -= 1 T = (M+a)*kazu - S if i == N - P: ...
[ "call.remove" ]
629,047
629,048
u557494880
python
p02824
import bisect N,M,V,P=map(int,input().split()) A=list(map(int,input().split())) A.sort() def is_ok(ind): bigs = bisect.bisect_right(A,A[ind]+M) if N-bigs >= P: return False votes = M*(V-1) j = 0 for i in range(N-1,-1,-1): if i==ind: continue if j < P-1: votes = max(votes-M,0) else...
import bisect N,M,V,P=map(int,input().split()) A=list(map(int,input().split())) A.sort() def is_ok(ind): bigs = bisect.bisect_right(A,A[ind]+M) if N-bigs >= P: return False votes = M*(V-1) j = 0 for i in range(N-1,-1,-1): if i==ind: continue if j < P-1: votes = max(votes-M,0) else...
[ "assignment.value.change", "expression.operation.unary.remove" ]
629,065
629,066
u375076148
python
p02824
from bisect import bisect_right N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A.sort() A_m = sorted(set(A)) n = len(A_m) ok = n-1 ng = -1 while ng+1 < ok: c = (ok+ng)//2 a = A_m[c] idx = bisect_right(A, a) if idx >= N-P: ok = c continue if M < A[-P]-a: ...
from bisect import bisect_right N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A.sort() A_m = sorted(set(A)) n = len(A_m) ok = n-1 ng = -1 while ng+1 < ok: c = (ok+ng)//2 a = A_m[c] idx = bisect_right(A, a) if idx > N-P: ok = c continue if M < A[-P]-a: ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
629,074
629,075
u467736898
python
p02824
from bisect import bisect_right N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A.sort() A_m = sorted(set(A)) n = len(A_m) ok = n-1 ng = -1 while ng+1 < ok: c = (ok+ng)//2 a = A_m[c] idx = bisect_right(A, a) if idx >= N-P: ok = c continue if N-V < A[-P]-a:...
from bisect import bisect_right N, M, V, P = map(int, input().split()) A = list(map(int, input().split())) A.sort() A_m = sorted(set(A)) n = len(A_m) ok = n-1 ng = -1 while ng+1 < ok: c = (ok+ng)//2 a = A_m[c] idx = bisect_right(A, a) if idx > N-P: ok = c continue if M < A[-P]-a: ...
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "expression.operation.binary.remove" ]
629,076
629,075
u467736898
python
p02824
n,m,v,p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) tg = a[p-1] l = p-1 r = n biggest = 0 print(a) while l<r: x = (l+r)//2 if a[p-1]-a[x]<=m: border = v*m-(n-x+p-1)*m biggest = sum([a[x]+m-a[j] for j in range(p-1,x)]) else: r = x conti...
n,m,v,p = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) tg = a[p-1] l = p-1 r = n biggest = 0 while l<r: x = (l+r)//2 if a[p-1]-a[x]<=m: border = v*m-(n-x+p-1)*m biggest = sum([a[x]+m-a[j] for j in range(p-1,x)]) else: r = x continue i...
[ "call.remove" ]
629,115
629,116
u905582793
python
p02829
A = int(input()) B = int(input()) l = [1,2,3] l.remove(A) l.remove(B) print(l)
A = int(input()) B = int(input()) l = [1,2,3] l.remove(A) l.remove(B) print(l[0])
[]
629,456
629,457
u309120194
python
p02829
a = int(input()) b = int(input()) t = set([1, 2, 3]) s = set([a,b]) ans = t - s print(list(ans[0]))
a = int(input()) b = int(input()) t = set([1, 2, 3]) s = set([a,b]) ans = t - s print(list(ans)[0])
[ "call.arguments.change" ]
629,466
629,467
u871841829
python
p02829
a=int(input()) b=int(input()) x=[1,2,3] x=x.remove(a) x=x.remove(b) print(x[0])
a=int(input()) b=int(input()) x=[1,2,3] x.remove(a) x.remove(b) print(x[0])
[ "assignment.remove" ]
629,472
629,473
u243159381
python
p02829
a=int(input()) b=int(input()) l=[] l.append(a) l.append(b) if '1' not in l: print(1) elif '2' not in l: print(2) else: print(3)
a=int(input()) b=int(input()) l=[] l.append(a) l.append(b) if 1 not in l: print(1) elif 2 not in l: print(2) else: print(3)
[ "control_flow.branch.if.condition.change" ]
629,488
629,489
u422977492
python
p02829
S=set(int(input())for i in range(2)) print({1,2,3}-S)
S=set(int(input())for i in range(2)) print(list({1,2,3}-S)[0])
[ "call.arguments.add" ]
629,498
629,499
u729119068
python
p02829
a=int(input()) b=int(input()) s=[1,2,3] s.remove(a) s.remove(b) print(s)
a=int(input()) b=int(input()) s=[1,2,3] s.remove(a) s.remove(b) print(s[0])
[]
629,505
629,506
u437351386
python
p02829
a = int(input()) b = int(input()) if a == 2 and b == 3 or b == 3 and a == 2: print('1') elif a == 1 and b == 2 or b == 1 and a == 2: print('3') else: print('2')
a = int(input()) b = int(input()) if a == 2 and b == 3 or b == 2 and a == 3: print('1') elif a == 1 and b == 2 or b == 1 and a == 2: print('3') else: print('2')
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
629,511
629,512
u409500730
python
p02829
a = int(input()) b = int(input()) if a == 1: if b == 2: print(3) else: print(2) if a == 2: if b == 1: print(3) else: print(1) if a == 3: if b == 1: print(2) else: printj(1)
a = int(input()) b = int(input()) if a == 1: if b == 2: print(3) else: print(2) if a == 2: if b == 1: print(3) else: print(1) if a == 3: if b == 1: print(2) else: print(1)
[ "identifier.change", "call.function.change", "io.output.change" ]
629,513
629,514
u380669795
python
p02829
ans = [1,2,3] a = int(input()) b = int(input()) ans.remove(a) ans.remove(b) print(ans)
ans = [1,2,3] a = int(input()) b = int(input()) ans.remove(a) ans.remove(b) print(ans[0])
[]
629,517
629,518
u085329544
python
p02829
A = int(input()) B = int(input()) L = A + B print(5 - L)
A = int(input()) B = int(input()) L = A + B print(5 - L + 1)
[ "expression.operation.binary.add" ]
629,523
629,524
u051496905
python
p02829
a = int(input()) b = int(input()) if (a == 1 and b == 2) or (a == 2 and b == 1): print(3) elif (a == 1 and b == 3) or (a == 3 and b == 1): print(2) elif (a == 2 and b == 3) or (a == 2 or b == 3): print(1)
a = int(input()) b = int(input()) if (a == 1 and b == 2) or (a == 2 and b == 1): print(3) elif (a == 1 and b == 3) or (a == 3 and b == 1): print(2) elif (a == 2 and b == 3) or (a == 3 or b == 2): print(1)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
629,533
629,534
u794544096
python
p02829
A=int(input()) B=int(input()) c=[1,2,3] c.remove(A) c.remove(B) print(c)
A=int(input()) B=int(input()) c=[1,2,3] c.remove(A) c.remove(B) print(c[0])
[]
629,539
629,540
u038819082
python
p02829
A = int(input()) B = int(input()) if A == 1 and B == 2: print(3) elif A == 1 and B == 3: print(2) elif A == 2 and B == 1: print(3) elif A == 2 and B == 3: print(1) elif A == 3 and B == 1: print(2) else: print(3)
A = int(input()) B = int(input()) if A == 1 and B == 2: print(3) elif A == 1 and B == 3: print(2) elif A == 2 and B == 1: print(3) elif A == 2 and B == 3: print(1) elif A == 3 and B == 1: print(2) else: print(1)
[ "literal.number.integer.change", "call.arguments.change", "io.output.change" ]
629,541
629,542
u685244071
python
p02829
a=int(input()) b=int(input()) abc=[1,2,3] abc.pop(a) abc.pop(b) print(abc[0])
a=int(input()) b=int(input()) abc=[1,2,3] abc.remove(a) abc.remove(b) print(abc[0])
[ "identifier.change" ]
629,543
629,544
u905793676
python
p02829
a = int(input());b = int(input()) ans = [1, 2, 3].delete(a).delete(b) print(ans[0])
a = int(input()); b=int(input()) ans = [1, 2, 3] ans.remove(a) ans.remove(b) print(ans[0])
[ "identifier.change" ]
629,545
629,546
u595952233
python
p02829
A=input() B=input() print((6-A-B))
A=int(input()) B=int(input()) print((6-A-B))
[ "assignment.value.change", "identifier.change", "call.function.change", "call.arguments.change" ]
629,551
629,552
u663089555
python
p02829
a=input() b=input() l=[1,2,3] l.remove(a) l.remove(b) ans=l[0] print(ans)
a=int(input()) b=int(input()) l=[1,2,3] l.remove(a) l.remove(b) ans=l[0] print(ans)
[ "assignment.value.change", "identifier.change", "call.function.change", "call.arguments.change" ]
629,559
629,560
u823585596
python
p02829
A = int(input()) B = int(input()) for i in range(1,3): if i != A and i != B: print(i)
A = int(input()) B = int(input()) for i in range(1,4): if i != A and i != B: print(i)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
629,567
629,568
u178079174
python
p02829
A = int(input()) B = int(input()) for i in range (1, 4): if i != A != B: print(i)
A = int(input()) B = int(input()) for i in range (1, 4): if i != A and i != B: print(i) break
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "control_flow.break.add" ]
629,571
629,572
u331997680
python
p02829
a=int(input()) b=int(input()) c=a+b if c==3: print("2") elif c==4: print("3") else: print("1")
a=int(input()) b=int(input()) c=a+b if c==3: print("3") elif c==4: print("2") else: print("1")
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
629,577
629,578
u039189422
python
p02829
A = int(input()) B = int(input()) if A != B != 1: print(1) elif A != B != 2: print(2) else: print(3)
A = int(input()) B = int(input()) if A != 1 and B != 1: print(1) elif A != 2 and B != 2: print(2) else: print(3)
[ "control_flow.branch.if.condition.change" ]
629,583
629,584
u581603131
python