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 |
|---|---|---|---|---|---|---|---|
p02691 | n = int(input())
a = list(map(int, input().split()))
count = 0
d={}
for i in range(n):
if i - a[i] in d:
count+=d[i - a[i]]
if i + a[i] in d:
d[i+a[i]] + 1
else:
d[i+a[i]] = 1
print(count) | n = int(input())
a = list(map(int, input().split()))
count = 0
d={}
for i in range(n):
if i - a[i] in d:
count+=d[i - a[i]]
if i + a[i] in d:
d[i+a[i]] += 1
else:
d[i+a[i]] = 1
print(count) | [
"assignment.compound.arithmetic.replace.add",
"expression.operator.arithmetic.replace.remove",
"expression.operation.binary.change"
] | 430,359 | 430,360 | u566159623 | python |
p02691 | # class Map(dict):
# def __missing__(self, key):
# # この割当てなしのほうが速い。
# # self[key] = 0
# return 0
def main():
int(input())
d = {}
ans = 0
for i, height in enumerate(input().split()):
height = int(height)
# 引き算のほうの i は足し算のよりも大きい。
# 従って,このように順番に見ていく必要が... | # class Map(dict):
# def __missing__(self, key):
# # この割当てなしのほうが速い。
# # self[key] = 0
# return 0
def main():
int(input())
d = {}
ans = 0
for i, height in enumerate(input().split()):
height = int(height)
# 引き算のほうの i は足し算のよりも大きい。
# 従って,このように順番に見ていく必要が... | [
"assignment.value.change"
] | 430,385 | 430,386 | u512212329 | python |
p02691 | N = int(input())
# N = int(input())
A = list(map(int, input().split()))
ans = 0
d1 = {}
d2 = {}
for i in range(N):
if i+1 + A[i] in d1:
d1[i+1 + A[i]] += 1
else:
d1[i+1 + A[i]] = 1
if i+1 - A[i] in d2:
d2[i+1 - A[i]] += 1
else:
d2[i+1 - A[i]] = 1
for a in d1.keys():
... | N = int(input())
# N = int(input())
A = list(map(int, input().split()))
ans = 0
d1 = {}
d2 = {}
for i in range(N):
if i+1 + A[i] in d1:
d1[i+1 + A[i]] += 1
else:
d1[i+1 + A[i]] = 1
if i+1 - A[i] in d2:
d2[i+1 - A[i]] += 1
else:
d2[i+1 - A[i]] = 1
for a in d1.keys():
... | [
"expression.operation.binary.remove"
] | 430,387 | 430,388 | u648901783 | python |
p02691 | import collections
N = int(input())
A = list(map(int, input().split()))
L = [i + A[i] for i in range(N)]
R = [i - A[i] for i in range(N)]
countL = collections.Counter(L)
countR = collections.Counter(R)
print([countL[n] * countR[n] for n in countL.keys()]) | import collections
N = int(input())
A = list(map(int, input().split()))
L = [i + A[i] for i in range(N)]
R = [i - A[i] for i in range(N)]
countL = collections.Counter(L)
countR = collections.Counter(R)
print(sum([countL[n] * countR[n] for n in countL.keys()])) | [
"call.arguments.add",
"call.arguments.change"
] | 430,391 | 430,392 | u430336181 | python |
p02691 | import sys
input = sys.stdin.readline
def main():
n = int(input())
a_list = list(map(int, input().split()))
c = [0] * n
s = 0
for i, a in enumerate(a_list):
if i+a < n:
d[i+a] += 1
if i-a >= 0:
s += d[i-a]
print(s)
if __name__ == '__main__':
main() | import sys
input = sys.stdin.readline
def main():
n = int(input())
a_list = list(map(int, input().split()))
c = [0] * n
s = 0
for i, a in enumerate(a_list):
if i+a < n:
c[i+a] += 1
if i-a >= 0:
s += c[i-a]
print(s)
if __name__ == '__main__':
main() | [
"identifier.change"
] | 430,427 | 430,428 | u690554532 | python |
p02691 | N = int(input())
A = list(map(int, input().split()))
check = {}
ans = 0
for i in range(N):
x = i - A[i]
y = A[i] + i
ans += check.get(x, 0)
check.setdefault(y, 0)
check[y] += 1
print(ans)
print(check) | N = int(input())
A = list(map(int, input().split()))
check = {}
ans = 0
for i in range(N):
x = i - A[i]
y = A[i] + i
ans += check.get(x, 0)
check.setdefault(y, 0)
check[y] += 1
print(ans) | [
"call.remove"
] | 430,451 | 430,452 | u429029348 | python |
p02691 | n = int(input())
a = list(map(int,input().split()))
box = [[0,0] for i in range(n)]
for i in range(n):
num = i + 1
if 0 < num - a[i] < n:
box[a[i]-num][0] += 1
if 0 < a[i]+num < n:
box[a[i]-num][1] += 1
ans = 0
for i in range(n):
ans += box[i][0] * box[i][1]
print(ans)
| n = int(input())
a = list(map(int,input().split()))
box = [[0,0] for i in range(n)]
for i in range(n):
num = i + 1
if 0 < num - a[i] < n:
box[num - a[i]][0] += 1
if 0 < a[i]+num < n:
box[a[i]+num][1] += 1
ans = 0
for i in range(n):
ans += box[i][0] * box[i][1]
print(ans)
| [
"expression.operation.binary.remove",
"misc.opposites",
"expression.operator.arithmetic.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 430,627 | 430,628 | u664907598 | python |
p02691 | from collections import defaultdict
n = int(input())
a = np.array(list(map(int, input().split())))
ci = defaultdict(int)
cj = defaultdict(int)
for i in range(n):
ci[a[i]+i] += 1
cj[i-a[i]] += 1
cnt = 0
for k in ci.keys():
cnt += ci[k] * cj[k]
print(cnt) | from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
ci = defaultdict(int)
cj = defaultdict(int)
for i in range(n):
ci[a[i]+i] += 1
cj[i-a[i]] += 1
cnt = 0
for k in ci.keys():
cnt += ci[k] * cj[k]
print(cnt) | [
"call.remove",
"call.arguments.change"
] | 430,649 | 430,650 | u008608569 | python |
p02691 | import collections
N = int(input())
A = list((map(int,input().split())))
index = list(range(1,N+1))
R = [index[i] - A[i] for i in range(N)]
L = [index[j] + A[j] for j in range(N)]
R_dict = collections.Counter(R)
L_dict = collections.Counter(L)
ans=0
for i in R_dict.keys()&L_dict.keys():
ans+=max(R_dict[i], L_di... | import collections
N = int(input())
A = list((map(int,input().split())))
index = list(range(1,N+1))
R = [index[i] - A[i] for i in range(N)]
L = [index[j] + A[j] for j in range(N)]
R_dict = collections.Counter(R)
L_dict = collections.Counter(L)
ans=0
for i in R_dict.keys()&L_dict.keys():
ans+=R_dict[i]*L_dict[i]... | [
"call.remove",
"call.arguments.change"
] | 430,684 | 430,685 | u305885563 | python |
p02691 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
d = dict(collections.Counter([i + A[i-1] for i in range(1, N+1)]))
ans = sum([d.get(i - A[i-1], 0) for i in range(1, N+1)])
print(ans)
| from collections import Counter
N = int(input())
A = list(map(int, input().split()))
d = dict(Counter([i + A[i-1] for i in range(1, N+1)]))
ans = sum([d.get(i - A[i-1], 0) for i in range(1, N+1)])
print(ans)
| [] | 430,789 | 430,790 | u548545174 | python |
p02691 | N = int(input())
A = list(map(int, input().split()))
lst = [0] * N
ans = 0
for i in range(N):
if i + 1 + A[i] < n: #iは0から始まるので +1 してあげる
lst[i + A[i]] += 1
if i + 1 - A[i] >= 1:
ans += lst[i - A[i]]
print(ans) | N = int(input())
A = list(map(int, input().split()))
lst = [0] * N
ans = 0
for i in range(N):
if i + 1 + A[i] < N: #iは0から始まるので +1 してあげる
lst[i + A[i]] += 1
if i + 1 - A[i] >= 1:
ans += lst[i - A[i]]
print(ans) | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 430,801 | 430,802 | u641722141 | python |
p02691 | N = int(input())
A = list(map(int, input().split()))
lst = [0] * N
ans = 0
for i in range(N):
if i + 1 + A[i] < n: #iは0から始まるので +1 してあげる
lst[i + A[i]] += 1
if i + 1 - A[i] >= 1:
ans += lst[i + 1 - A[i]]
print(ans) | N = int(input())
A = list(map(int, input().split()))
lst = [0] * N
ans = 0
for i in range(N):
if i + 1 + A[i] < N: #iは0から始まるので +1 してあげる
lst[i + A[i]] += 1
if i + 1 - A[i] >= 1:
ans += lst[i - A[i]]
print(ans) | [
"identifier.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 430,803 | 430,802 | u641722141 | python |
p02691 | from collections import Counter
n = int(input())
a = list(map(int, input().split()))
r = []
for i, ai in enumerate(a):
l.append(i+ai)
r.append(i-ai)
ans = 0
b = Counter(r)
for i in l:
ans += b.get(i, 0)
print(ans)
| from collections import Counter
n = int(input())
a = list(map(int, input().split()))
l = []
r = []
for i, ai in enumerate(a):
l.append(i+ai)
r.append(i-ai)
ans = 0
b = Counter(r)
for i in l:
ans += b.get(i, 0)
print(ans)
| [
"assignment.add"
] | 430,806 | 430,807 | u530786533 | python |
p02691 | N = int(input())
A = list(map(int, input().split()))
S = [0]*N
D = [0]*N
for i in range(N):
if A[i]+i < N:
S[A[i]+i] += 1
if i - A[i] > 0:
D[i - A[i]] += 1
ans = 0
print(S,D)
for l in range(N):
ans += S[l]*D[l]
print(ans) | N = int(input())
A = list(map(int, input().split()))
S = [0]*N
D = [0]*N
for i in range(N):
if A[i]+i < N:
S[A[i]+i] += 1
if i - A[i] > 0:
D[i - A[i]] += 1
ans = 0
for l in range(N):
ans += S[l]*D[l]
print(ans) | [
"call.remove"
] | 430,841 | 430,842 | u231189826 | python |
p02691 | import collections
N = int(input())
A = list(map(int, input().split()))
L = [i+j for i, j in enumerate(A)]
R = [i-j for i, j in enumerate(A)]
l = collections.Counter(L)
r = collections.Counter(R)
for i in l.keys():
ans += l[i]*r[i]
print(ans) | import collections
N = int(input())
A = list(map(int, input().split()))
L = [i+j for i, j in enumerate(A)]
R = [i-j for i, j in enumerate(A)]
l = collections.Counter(L)
r = collections.Counter(R)
ans = 0
for i in l.keys():
ans += l[i]*r[i]
print(ans) | [
"assignment.add"
] | 430,952 | 430,953 | u686036872 | python |
p02691 | import collections
N = int(input())
A = list(map(int, input().split()))
L = [i+j for i, j in enumerate(A)]
R = [i-j for i, j in enumerate(A)]
l = collections.Counter(L)
r = collections.Counter(L)
for i in l.keys():
ans += l[i]*r[i]
print(ans) | import collections
N = int(input())
A = list(map(int, input().split()))
L = [i+j for i, j in enumerate(A)]
R = [i-j for i, j in enumerate(A)]
l = collections.Counter(L)
r = collections.Counter(R)
ans = 0
for i in l.keys():
ans += l[i]*r[i]
print(ans) | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 430,954 | 430,953 | u686036872 | python |
p02691 | # -*- coding: utf-8 -*-
# 入力を整数に変換して受け取る
def input_int():
return int(input())
# マイナス1した値を返却
def int1(x):
return int(x) - 1
# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
return map(int, input().split())
# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
return tuple(map(int, input().spl... | # -*- coding: utf-8 -*-
# 入力を整数に変換して受け取る
def input_int():
return int(input())
# マイナス1した値を返却
def int1(x):
return int(x) - 1
# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
return map(int, input().split())
# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
return tuple(map(int, input().spl... | [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change"
] | 430,986 | 430,987 | u852210959 | python |
p02691 | from collections import defaultdict
n = int(input())
A = list(map(int, input().split()))
B = []
for j in range(n):
B.append(j - A[j])
C = []
for i in range(n):
C.append(i + A[i])
d = defaultdict(int)
for j in A:
d[j] += 1
count = 0
for k in B:
count += d[k]
print(count) | from collections import defaultdict
n = int(input())
A = list(map(int, input().split()))
B = []
for j in range(n):
B.append(j - A[j])
C = []
for i in range(n):
C.append(i + A[i])
d = defaultdict(int)
for j in C:
d[j] += 1
count = 0
for k in B:
count += d[k]
print(count)
# 時間超過
# count = 0
# for i... | [
"identifier.change"
] | 431,128 | 431,129 | u164471280 | python |
p02691 | def main():
n = int(input())
a = list(map(int, input().split()))
d = [0] * n
ans = 0
for i in range(n):
ai = a[i]
l, r = i + ai, i - ai
if 0 <= l < n:
d[l] += 1
if 0 <= r < n:
ans += d[r]
print(d)
print(ans)
if __name__ == "__main... | def main():
n = int(input())
a = list(map(int, input().split()))
d = [0] * n
ans = 0
for i in range(n):
ai = a[i]
l, r = i + ai, i - ai
if 0 <= l < n:
d[l] += 1
if 0 <= r < n:
ans += d[r]
print(ans)
if __name__ == "__main__":
main()
| [
"call.remove"
] | 431,141 | 431,142 | u390727364 | python |
p02691 | n=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
for i in range(n):
L.append(i+A[i])
R.append(i-A[i])
from collections import Counter
zisyo=R.Counter(R)
ans=0
for i in L:
ans=ans+get(i,0)
print(ans)
| n=int(input())
A=list(map(int,input().split()))
L=[]
R=[]
for i in range(n):
L.append(i+A[i])
R.append(i-A[i])
from collections import Counter
zisyo=Counter(R)
ans=0
for i in L:
ans=ans+zisyo.get(i,0)
print(ans)
| [] | 431,210 | 431,211 | u437351386 | python |
p02691 | from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
ans = 0
for i, x in enumerate(A, 1):
ans += D[i-x]
D[x+i] += 1
print(ans, D) | from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
ans = 0
for i, x in enumerate(A, 1):
ans += D[i-x]
D[x+i] += 1
print(ans) | [
"call.arguments.change"
] | 431,247 | 431,248 | u595375942 | python |
p02691 | from collections import Counter
N,*A = map(int,open(0).read().split())
#j - i = Aj + Ai
#j - Aj = Ai + i
#L = i + Ai, R = j - Aj とおく
L = []
R = []
for i in range(N):
L.append(i+1 + A[i])
R.append(i+1 - A[i])
l = Counter(L)
r = Counter(R)
cnt = 0
for i in range(1,N+1):
if i in l and i in r:
cnt +=... | from collections import Counter
N,*A = map(int,open(0).read().split())
#j - i = Aj + Ai
#j - Aj = Ai + i
#L = i + Ai, R = j - Aj とおく
L = []
R = []
for i in range(N):
L.append(i+1 + A[i])
R.append(i+1 - A[i])
l = Counter(L)
r = Counter(R)
cnt = 0
a = []
for i in range(1,N+1):
if i in l and i in r:
... | [
"assignment.add"
] | 431,304 | 431,305 | u103557284 | python |
p02691 | def main():
n,a=map(int,open(0).read().split());d,s=[0]*n,0
for i,x in enumerate(a):
if i+x<n:d[i+x]+=1
if i-x>=0:s+=d[i-x]
print(s)
main() | def main():
n, *a = map(int,open(0).read().split())
d, s = [0]*n, 0
for i, x in enumerate(a):
if i+x<n:
d[i+x]+=1
if i-x>=0:
s+=d[i-x]
print(s)
main() | [] | 431,319 | 431,320 | u764215612 | python |
p02691 | def main():
n,a=map(int,open(0).read().split());d,s=[0]*n,0
for i,x in enumerate(a):
if i+x<n:d[i+x]+=1
if i-x>=0:s+=d[i-x]
print(s)
main() | def main():
n,*a=map(int,open(0).read().split());d,s=[0]*n,0
for i,x in enumerate(a):
if i+x<n:d[i+x]+=1
if i-x>=0:s+=d[i-x]
print(s)
main() | [] | 431,319 | 431,321 | u764215612 | python |
p02691 | def main():
n,a,d = int(input()),list(map(int, input().split())),[0]*n
for i,x in enumerate(a):
if i+x < n: d[i+x] += 1
print(sum([d[i-x] for i,x in enumerate(a) if i-x>=0]))
main() | def main():
n,a=int(input()),list(map(int, input().split()))
d=[0]*n
for i,x in enumerate(a):
if i+x<n:d[i+x]+=1
print(sum([d[i-x]for i,x in enumerate(a)if i-x>=0]))
main() | [
"assignment.variable.change"
] | 431,322 | 431,323 | u764215612 | python |
p02691 | def main():
n,a,d = int(input()),list(map(int, input().split())),[0]*n
for i,x in enumerate(a):
if i+x < n: d[i+x] += 1
print(sum([d[i-x] for i,x in enumerate(a) if i-x>=0]))
main() | def main():
n,a = int(input()),list(map(int, input().split()))
d = [0]*n
for i,x in enumerate(a):
if i+x<n:d[i+x]+=1
print(sum([d[i-x]for i,x in enumerate(a)if i-x>=0]))
main() | [
"assignment.variable.change"
] | 431,322 | 431,324 | u764215612 | python |
p02691 | def main():
n,a,d = int(input()),list(map(int, input().split())),[0]*n
for i,x in enumerate(a):
if i+x < n: d[i+x] += 1
print(sum([d[i-x] for i,x in enumerate(a) if i-x>=0]))
main() | def main():
n,a = int(input()),list(map(int, input().split()))
d = [0]*n
for i,x in enumerate(a):
if i+x<n:d[i+x] += 1
print(sum([d[i-x]for i,x in enumerate(a)if i-x>=0]))
main() | [
"assignment.variable.change"
] | 431,322 | 431,325 | u764215612 | python |
p02691 | import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
f=cc.defaultdict(int)
n,=I()
l=I()
ans=0
for i in range(n):
d[l[i]+i]+=1
ans+=d[i-l[i]]
print(ans)
| import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
d=cc.defaultdict(int)
n,=I()
l=I()
ans=0
for i in range(n):
d[l[i]+i]+=1
ans+=d[i-l[i]]
print(ans)
| [
"assignment.variable.change",
"identifier.change"
] | 431,379 | 431,380 | u995109095 | python |
p02691 | N = int(input())
A = tuple( map(int, input().split()) )
dict_ = {}
ans = 0
for i in range(N):
k = (i+1) - A[i]
if k in dict_:
ans += dict[k]
ad = (i+1) + A[i]
if ad in dict_:
dict_[ad] = dict_[ad] + 1
dict_[ad] = 1
print(ans) | N = int(input())
A = tuple( map(int, input().split()) )
dict_ = {}
ans = 0
for i in range(N):
k = (i+1) - A[i]
if k in dict_:
ans += dict_[k]
ad = (i+1) + A[i]
if ad in dict_:
dict_[ad] = dict_[ad] + 1
else:
dict_[ad] = 1
print(ans)
| [
"identifier.change"
] | 431,503 | 431,504 | u779728630 | python |
p02691 | n = int(input())
A=list(map(int,input().split()))
cnt=0
B=[]
C=[]
for i,a in enumerate(A):
B.append(A[i]+i)
C.append(A[i]-i)
from collections import Counter
Bd=dict(Counter(B))
Cd=dict(Counter(C))
cnt=0
for k in Bd.keys():
b=Bd.get(k)
c=Cd.get(k)
if b and c:
cnt+=b*c
print(cnt)
| n = int(input())
A=list(map(int,input().split()))
cnt=0
B=[]
C=[]
for i,a in enumerate(A):
B.append(A[i]+i)
C.append(A[i]-i)
from collections import Counter
Bd=dict(Counter(B))
Cd=dict(Counter(C))
cnt=0
for k in Bd.keys():
b=Bd.get(k)
c=Cd.get(-k)
if b and c:
cnt+=b*c
print(cnt)
| [
"expression.operation.unary.add",
"call.arguments.change"
] | 431,553 | 431,554 | u260216890 | python |
p02691 | n, *A = map(int, open(0).read().split())
ans = 0
for i, a in enumerate(A, 1):
x, y = i+a, i-a
d[x] = d.get(x, 0)+1
ans += d.get(y, 0)
print(ans) | n, *A = map(int, open(0).read().split())
ans, d = 0, {}
for i, a in enumerate(A, 1):
x, y = i+a, i-a
d[x] = d.get(x, 0)+1
ans += d.get(y, 0)
print(ans) | [] | 431,637 | 431,638 | u781262926 | python |
p02691 | # 二分探索モジュール bisect
# 添字はiとjの分で相殺(本当の添字は+1が必要だが[(i+1)-(j+1)]なのでいらない(以下は式変形))
import bisect
N = int(input())
A = list(map(int, input().split()))
X = [A[i]+i for i in range(N)]
Y = [j - A[j] for j in range(N)]
ans = 0
X.sort()
for i in range(N):
ans += bisect.bisect_left(Y,X[i]) - bisect.bisect_right(Y,X[i])
print(ans... | # 二分探索モジュール bisect
# 添字はiとjの分で相殺(本当の添字は+1が必要だが[(i+1)-(j+1)]なのでいらない(以下は式変形))
import bisect
N = int(input())
A = list(map(int, input().split()))
X = [A[i]+i for i in range(N)]
Y = [j - A[j] for j in range(N)]
ans = 0
Y.sort()
for i in range(N):
ans += bisect.bisect_right(Y,X[i]) - bisect.bisect_left(Y,X[i])
print(ans... | [
"identifier.change",
"expression.operation.binary.change"
] | 431,657 | 431,658 | u298945776 | python |
p02692 | N, A, B, C = map(int, input().split())
v = [A, B, C]
s = [-1 for i in range(N)]
for i in range(N):
t = input()
print(t)
if t == "AB":
s[i] = 0
if t == "BC":
s[i] = 1
if t == "AC":
s[i] = 2
ans = [-1 for i in range(N)]
OK = True
for i in range(N):
p = s[i]
q = (s[i]+1... | N, A, B, C = map(int, input().split())
v = [A, B, C]
s = [-1 for i in range(N)]
for i in range(N):
t = input()
if t == "AB":
s[i] = 0
if t == "BC":
s[i] = 1
if t == "AC":
s[i] = 2
ans = [-1 for i in range(N)]
OK = True
for i in range(N):
p = s[i]
q = (s[i]+1)%3
if v[... | [
"call.remove"
] | 431,807 | 431,808 | u228214259 | python |
p02692 | #
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter,default... | #
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter,default... | [
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 431,892 | 431,893 | u788137651 | python |
p02692 | n,a,b,c = map(int,input().split())
s = [input() for i in range(n)]+[0]
# if [a,b,c].count(0) >= 2:
# print("No")
ans = ""
# print("Yes")
for i in range(n):
if s[i] == "AB":
if a==1 and b==1:
if s[i+1] =="BC":
ans+="B"
b+=1
a-=1
elif a<... | n,a,b,c = map(int,input().split())
s = [input() for i in range(n)]+[0]
# if [a,b,c].count(0) >= 2:
# print("No")
ans = ""
# print("Yes")
for i in range(n):
if s[i] == "AB":
if a==1 and b==1 and s[i+1] =="BC":
ans+="B"
b+=1
a-=1
elif a<=b:
ans+="A"... | [] | 431,896 | 431,895 | u738898077 | python |
p02692 | def f(A, i, j, k, nex,res):
if A[i] == A[j] == 0:
print("No")
exit()
elif A[i] == A[j] == 1 and A[k] == 0:
if i in nex:
A[i] += 1
A[j] -= 1
return "ABC"[i]
else:
A[i] -= 1
A[j] += 1
return "ABC"[j]
else:
... | def f(A, i, j, k, nex,res):
if A[i] == A[j] == 0:
print("No")
exit()
elif A[i] == A[j] == 1 and A[k] == 0:
if i in nex:
A[i] += 1
A[j] -= 1
return "ABC"[i]
else:
A[i] -= 1
A[j] += 1
return "ABC"[j]
else:
... | [
"assignment.add"
] | 431,975 | 431,976 | u974620347 | python |
p02692 | import sys, copy, math, heapq, bisect
from itertools import accumulate
from collections import deque, defaultdict, Counter
sys.setrecursionlimit(500000)
N,A,B,C = map(int,input().split())
ABC = [A,B,C]
S = []
SS = ('A','B','C')
d = [0,0,0]
flag = True
for i in range(N):
s = input()
if s=="AB":
S.appen... | import sys, copy, math, heapq, bisect
from itertools import accumulate
from collections import deque, defaultdict, Counter
sys.setrecursionlimit(500000)
N,A,B,C = map(int,input().split())
ABC = [A,B,C]
S = []
SS = ('A','B','C')
d = [0,0,0]
flag = True
for i in range(N):
s = input()
if s=="AB":
S.appen... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 432,045 | 432,046 | u151625340 | python |
p02692 | n, *x = map(int, input().split())
k = 'ABC'
ans = []
s = [input() for _ in range(n)]
for p in range(n):
sp = s[p]
if sp == 'AB':
i = 0
j = 1
elif sp == 'BC':
i = 1
j = 2
else:
i = 0
j = 2
if x[i] == x[j] == 0:
print('No')
break
if x... | n, *x = map(int, input().split())
k = 'ABC'
ans = []
s = [input() for _ in range(n)]
for p in range(n):
sp = s[p]
if sp == 'AB':
i = 0
j = 1
elif sp == 'BC':
i = 1
j = 2
else:
i = 0
j = 2
if x[i] == x[j] == 0:
print('No')
break
if x... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 432,072 | 432,073 | u365364616 | python |
p02692 | def put(ret, val):
if val == 0:
ret.append('A')
elif val == 1:
ret.append('B')
else:
ret.append('C')
n, a, b, c = map(int, input().split())
s = []
for i in range(n):
tmp = input()
if tmp == 'AB':
val = 0
elif tmp == 'BC':
val = 1
else:
val ... | def put(ret, val):
if val == 0:
ret.append('A')
elif val == 1:
ret.append('B')
else:
ret.append('C')
n, a, b, c = map(int, input().split())
s = []
for i in range(n):
tmp = input()
if tmp == 'AB':
val = 0
elif tmp == 'BC':
val = 1
else:
val ... | [
"call.arguments.add"
] | 432,159 | 432,160 | u550294762 | python |
p02692 | n,a,b,c = map(int, input().split())
ans = []
number = dict()
number['A'] = a
number['B'] = b
number['C'] = c
query = [input() for i in range(n)]
for i in range(n):
s = query[i]
s_1, s_2 = s[0], s[1]
if number[s_1] == 0 and number[s_2] == 0:
print("No")
exit()
else:
if number[s_1]... | n,a,b,c = map(int, input().split())
ans = []
number = dict()
number['A'] = a
number['B'] = b
number['C'] = c
query = [input() for i in range(n)]
for i in range(n):
s = query[i]
s_1, s_2 = s[0], s[1]
if number[s_1] == 0 and number[s_2] == 0:
print("No")
exit()
else:
if number[s_1]... | [
"call.arguments.change"
] | 432,176 | 432,177 | u691896522 | python |
p02692 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
def check(s):
if dict_x[s[0]] == 0 and dict_x[s[1]] == 0:
return "NOT"
elif dict_x[s[0]] > 0 and dict_x[s[1]] == 0:
return s[1]
elif dict_x[s[0]] == 0 and dict_x[s[1]] > 0:
return s[0]
elif dict_x[s[0]] == 1 and dict_x[s[1]] == 1:
... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
def check(s):
if dict_x[s[0]] == 0 and dict_x[s[1]] == 0:
return "NOT"
elif dict_x[s[0]] > 0 and dict_x[s[1]] == 0:
return s[1]
elif dict_x[s[0]] == 0 and dict_x[s[1]] > 0:
return s[0]
elif dict_x[s[0]] == 1 and dict_x[s[1]] == 1:
... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 432,204 | 432,205 | u264312747 | python |
p02686 | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (と)の数は同じ、最下点に注目
N = ir()
S = [[1 if x == '(' else -1 for x in list(sr())] for _ in range(N)]
pos = []
neg = []
for s in S:
temp = 0
mi = 0
for x in s:
temp += x
... | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (と)の数は同じ、最下点に注目
N = ir()
S = [[1 if x == '(' else -1 for x in list(sr())] for _ in range(N)]
pos = []
neg = []
for s in S:
temp = 0
mi = 0
for x in s:
temp += x
... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"identifier.change",
"control_flow.branch.if.condition.change"
] | 432,287 | 432,288 | u600402037 | python |
p02686 | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (と)の数は同じ、最下点に注目
N = ir()
S = [[1 if x == '(' else -1 for x in list(sr())] for _ in range(N)]
pos = []
neg = []
for s in S:
temp = 0
mi = 0
for x in s:
temp += x
... | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# (と)の数は同じ、最下点に注目
N = ir()
S = [[1 if x == '(' else -1 for x in list(sr())] for _ in range(N)]
pos = []
neg = []
for s in S:
temp = 0
mi = 0
for x in s:
temp += x
... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 432,289 | 432,288 | u600402037 | python |
p02686 | import sys
N = int(sys.stdin.readline().strip())
S = []
for _ in range(N):
s_i = sys.stdin.readline().strip()
S.append(s_i)
# left bracket - right bracketを高さとした、最小の高さと最終的な高さの座標列
# ex)
# ")": (-1, -1)
# "(": (1, 1)
# "()": (1, 0)
# ")()(": (-1, 0)
# "))))(((((: (-4, 1)
plus_seqs = []
minus_seqs = []
for s_i ... | import sys
N = int(sys.stdin.readline().strip())
S = []
for _ in range(N):
s_i = sys.stdin.readline().strip()
S.append(s_i)
# left bracket - right bracketを高さとした、最小の高さと最終的な高さの座標列
# ex)
# ")": (-1, -1)
# "(": (1, 1)
# "()": (1, 0)
# ")()(": (-1, 0)
# "))))(((((: (-4, 1)
plus_seqs = []
minus_seqs = []
for s_i ... | [
"expression.operation.binary.remove"
] | 432,292 | 432,293 | u028973125 | python |
p02686 | def main():
n = int(input())
S = [input() for _ in [0]*n]
s2 = []
s3 = []
for s in S:
temp = [0, 0]
m = 0
now = 0
for i in s:
if i == "(":
now += 1
else:
now -= 1
m = min(m, now)
temp[0] = -m
... | def main():
n = int(input())
S = [input() for _ in [0]*n]
s2 = []
s3 = []
for s in S:
temp = [0, 0]
m = 0
now = 0
for i in s:
if i == "(":
now += 1
else:
now -= 1
m = min(m, now)
temp[0] = -m
... | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"misc.opposites",
"expression.operator.compare.change",
"expression.operation.unary.arithmetic.remove",
"call.arguments.change",
"expression.operation.unary.add"
] | 432,298 | 432,299 | u532966492 | python |
p02686 | def main():
n = int(input())
S = [input() for _ in [0]*n]
s2 = []
s3 = []
for s in S:
temp = [0, 0]
m = 0
now = 0
for i in s:
if i == "(":
now += 1
else:
now -= 1
m = min(m, now)
temp[0] = -m
... | def main():
n = int(input())
S = [input() for _ in [0]*n]
s2 = []
s3 = []
for s in S:
temp = [0, 0]
m = 0
now = 0
for i in s:
if i == "(":
now += 1
else:
now -= 1
m = min(m, now)
temp[0] = -m
... | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"expression.operator.compare.change",
"expression.operation.unary.arithmetic.remove",
"call.arguments.change",
"expression.operation.unary.add"
] | 432,300 | 432,299 | u532966492 | python |
p02686 | N = int(input())
#INF = float('inf')
def check(A):
th = 0 #高さの合計
for i in range(len(A)):
b = A[i][0]
h = A[i][1]
if th + b < 0:
return False
else:
th += h
return True
L = []
R = []
goukei = 0
for i in range(N):
temp = str(input())
b= 0 #最下点
h = 0 #ゴールの位置
for j in range(... | N = int(input())
#INF = float('inf')
def check(A):
th = 0 #高さの合計
for i in range(len(A)):
b = A[i][0]
h = A[i][1]
if th + b < 0:
return False
else:
th += h
return True
L = []
R = []
goukei = 0
for i in range(N):
temp = str(input())
b= 0 #最下点
h = 0 #ゴールの位置
for j in range(... | [
"call.remove"
] | 432,322 | 432,323 | u197457087 | python |
p02686 | N = int(input())
def cnt(s):
r = [0] * (len(s)+1)
for i, v in enumerate(s):
if v == '(':
r[i+1] = r[i] + 1
else:
r[i+1] = r[i] - 1
return r[0], r[-1], min(r)
# S1 := 始点 < 終点
S1 = []
# S2 := 始点 => 終点
S2 = []
for i in range(N):
s = input()
t = tuple(cnt(s))
... | N = int(input())
def cnt(s):
r = [0] * (len(s)+1)
for i, v in enumerate(s):
if v == '(':
r[i+1] = r[i] + 1
else:
r[i+1] = r[i] - 1
return r[0], r[-1], min(r)
# S1 := 始点 < 終点
S1 = []
# S2 := 始点 => 終点
S2 = []
for i in range(N):
s = input()
t = tuple(cnt(s))
... | [
"assignment.change"
] | 432,372 | 432,371 | u814781830 | python |
p02686 | def main():
n = int(input())
l_0 = []
r_0 = []
ls_plus = []
ls_minus = []
sum_l = 0
sum_r = 0
for i in range(n):
s = input()
left, right = 0, 0
for j in range(len(s)):
if s[j] == '(':
right += 1
else:
if righ... | def main():
n = int(input())
l_0 = []
r_0 = []
ls_plus = []
ls_minus = []
sum_l = 0
sum_r = 0
for i in range(n):
s = input()
left, right = 0, 0
for j in range(len(s)):
if s[j] == '(':
right += 1
else:
if righ... | [
"call.arguments.change"
] | 432,375 | 432,376 | u743420240 | python |
p02686 | import sys
def input():
return sys.stdin.readline().strip()
def solve():
N = int(input())
inc_chunks = []
dec_chunks = []
for _ in range(N):
depth = 0
level = 0
for c in input():
if c == '(':
level += 1
else:
level -... | import sys
def input():
return sys.stdin.readline().strip()
def solve():
N = int(input())
inc_chunks = []
dec_chunks = []
for _ in range(N):
depth = 0
level = 0
for c in input():
if c == '(':
level += 1
else:
level -... | [
"expression.operation.binary.remove"
] | 432,379 | 432,380 | u888092736 | python |
p02686 | n = int(input())
lr1, lr2 = [], []
res = 0
for _ in range(n):
s = input()
m = len(s)
l, r = 0, 0
tmp = 0
for i in range(m):
if s[i] == ')':
tmp += 1
else:
tmp -= 1
l = max(l, tmp)
tmp = 0
for i in range(m):
if s[m-1-i] == '(':
... | n = int(input())
lr1, lr2 = [], []
res = 0
for _ in range(n):
s = input()
m = len(s)
l, r = 0, 0
tmp = 0
for i in range(m):
if s[i] == ')':
tmp += 1
else:
tmp -= 1
l = max(l, tmp)
tmp = 0
for i in range(m):
if s[m-1-i] == '(':
... | [
"expression.operation.unary.arithmetic.remove",
"call.arguments.change"
] | 432,381 | 432,382 | u139112865 | python |
p02686 | from itertools import *
n,*s=open(0).read().split()
u=[[min(accumulate(chain([0],t),lambda a,b: a+(1 if b=="(" else -1),initial=0)),2*t.count("(")-len(t)] for t in s]
m=0
for c,d in chain(sorted([x for x in u if x[1]>=0])[::-1],sorted([x for x in u if x[1]<0],key=lambda z:z[0]-z[1])):
if m+c<0:print("No");break
... | from itertools import *
n,*s=open(0).read().split()
u=[[min(accumulate(chain([0],t),lambda a,b: a+(1 if b=="(" else -1))),2*t.count("(")-len(t)] for t in s]
m=0
for c,d in chain(sorted([x for x in u if x[1]>=0])[::-1],sorted([x for x in u if x[1]<0],key=lambda z:z[0]-z[1])):
if m+c<0:print("No");break
m+=d
else... | [
"call.arguments.change"
] | 432,416 | 432,417 | u989345508 | python |
p02686 | from sys import exit
from itertools import accumulate,chain
n,*s=open(0).read().split()
t=[2*i.count("(")-len(i) for i in s]
if sum(t)!=0:
print("No");exit()
st=[[min(accumulate(s_,lambda a,b: a+(1 if b=="(" else -1),initial=0)),t_] for s_,t_ in zip(s,t)]
now=0
for c in chain(sorted([x for x in st if x[1]>=0])[::-1... | from sys import exit
from itertools import accumulate,chain
n,*s=open(0).read().split()
t=[2*i.count("(")-len(i) for i in s]
if sum(t)!=0:
print("No");exit()
st=[[min(accumulate(s_,lambda a,b: a+(1 if b=="(" else -1),initial=0)),t_] for s_,t_ in zip(s,t)]
now=0
for c in chain(sorted([x for x in st if x[1]>=0])[::-1... | [
"call.arguments.keyword_argument.add"
] | 432,419 | 432,420 | u989345508 | python |
p02686 | from sys import exit
from itertools import accumulate,chain
n,*s=open(0).read().split()
t=map(lambda x:2*x.count("(")-len(x),s)
if sum(t)!=0:
print("No")
exit()
#pypyではinitialだめ
st=[[t_,min(accumulate(s_,lambda a,b: a+(1 if b=="(" else -1),initial=0))] for s_,t_ in zip(s,t)]
now=sum(map(lambda x:x[0],filter(la... | from sys import exit
from itertools import accumulate,chain
n,*s=open(0).read().split()
t=list(map(lambda x:2*x.count("(")-len(x),s))
if sum(t)!=0:
print("No")
exit()
#pypyではinitialだめ
st=[[t_,min(accumulate(s_,lambda a,b: a+(1 if b=="(" else -1),initial=0))] for s_,t_ in zip(s,t)]
now=sum(map(lambda x:x[0],fil... | [
"call.add",
"call.arguments.change"
] | 432,421 | 432,422 | u989345508 | python |
p02686 | #!/usr/bin/env python3
import sys
input = sys.stdin.readline
n = int(input())
increasing = []
decreasing = []
for _ in range(n):
s = input().rstrip()
minima = 0
fin = 0
for ch in s:
if ch == ")":
fin -= 1
if fin < minima:
minima = fin
else:
... | #!/usr/bin/env python3
import sys
input = sys.stdin.readline
n = int(input())
increasing = []
decreasing = []
for _ in range(n):
s = input().rstrip()
minima = 0
fin = 0
for ch in s:
if ch == ")":
fin -= 1
if fin < minima:
minima = fin
else:
... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 432,423 | 432,424 | u052499405 | python |
p02686 | #!/usr/bin/env python3
import sys
input = sys.stdin.readline
n = int(input())
increasing = []
decreasing = []
for _ in range(n):
s = input().rstrip()
minima = 0
fin = 0
for ch in s:
if ch == ")":
fin -= 1
if fin < minima:
minima = fin
else:
... | #!/usr/bin/env python3
import sys
input = sys.stdin.readline
n = int(input())
increasing = []
decreasing = []
for _ in range(n):
s = input().rstrip()
minima = 0
fin = 0
for ch in s:
if ch == ")":
fin -= 1
if fin < minima:
minima = fin
else:
... | [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 432,425 | 432,424 | u052499405 | python |
p02686 | import sys
readline = sys.stdin.readline
def main():
N = int(readline())
Sp = []
Sm = []
total = 0
bm = 0
for i in range(N):
l = readline().strip()
print(l)
b = 0
h = 0
for j in range(len(l)):
if l[j] == '(':
h += 1
else:
h -= 1
b = min(b, h)
if h =... | import sys
readline = sys.stdin.readline
def main():
N = int(readline())
Sp = []
Sm = []
total = 0
bm = 0
for i in range(N):
l = readline().strip()
b = 0
h = 0
for j in range(len(l)):
if l[j] == '(':
h += 1
else:
h -= 1
b = min(b, h)
if h == 0 and b != ... | [
"call.remove"
] | 432,457 | 432,458 | u869567753 | python |
p02686 | import sys
readline = sys.stdin.readline
def main():
N = int(readline())
Sp = []
Sm = []
total = 0
bm = 0
for i in range(N):
l = readline()
b = 0
h = 0
for j in range(len(l)):
if l[j] == '(':
h += 1
else:
h -= 1
b = min(b, h)
if h == 0 and b != 0:
... | import sys
readline = sys.stdin.readline
def main():
N = int(readline())
Sp = []
Sm = []
total = 0
bm = 0
for i in range(N):
l = readline().strip()
b = 0
h = 0
for j in range(len(l)):
if l[j] == '(':
h += 1
else:
h -= 1
b = min(b, h)
if h == 0 and b != ... | [
"call.add"
] | 432,459 | 432,458 | u869567753 | python |
p02686 | n = int(input())
S = [input() for i in range(n)]
AB = []
for i in range(n):
a, b = 0, 0
for c in S[i]:
if c == '(':
b += 1
if c == ')':
if b > 0:
b -= 1
else:
a += 1
AB.append((a, b))
AB0 = [(a, b) for a, b in AB if -a + b >... | n = int(input())
S = [input() for i in range(n)]
AB = []
for i in range(n):
a, b = 0, 0
for c in S[i]:
if c == '(':
b += 1
if c == ')':
if b > 0:
b -= 1
else:
a += 1
AB.append((a, b))
AB0 = [(a, b) for a, b in AB if -a + b >... | [
"call.remove"
] | 432,462 | 432,463 | u997641430 | python |
p02686 | n = int(input())
s = [input() for _ in range(n)]
l = 0
r = 0
m = []
def fin():
print("No")
exit()
for word in s:
stack = []
for e in word:
if stack and stack[-1] == "(" and e == ")":
stack.pop()
else:
stack.append(e)
if stack:
if stack[0] == ")" ... | n = int(input())
s = [input() for _ in range(n)]
l = 0
r = 0
m = []
def fin():
print("No")
exit()
for word in s:
stack = []
for e in word:
if stack and stack[-1] == "(" and e == ")":
stack.pop()
else:
stack.append(e)
if stack:
if stack[0] == ")" ... | [
"identifier.change"
] | 432,464 | 432,465 | u893063840 | python |
p02686 | n = int(input())
lst_left = []
lst_right = []
total = 0
for i in range(n):
s = input()
h = 0
b = 0
for e in s:
if e == "(":
h += 1
else:
h -= 1
b = min(b, h)
if h>=0:
lst_left.append((b, h))
else:
lst_right.append((b-h, -h))
total += h
#lst_left = sorted(lst_left, key=lam... | n = int(input())
lst_left = []
lst_right = []
total = 0
for i in range(n):
s = input()
h = 0
b = 0
for e in s:
if e == "(":
h += 1
else:
h -= 1
b = min(b, h)
if h>=0:
lst_left.append((b, h))
else:
lst_right.append((b-h, -h))
total += h
#lst_left = sorted(lst_left, key=lam... | [
"call.add"
] | 432,467 | 432,468 | u626881915 | python |
p02692 | import sys
from collections import deque
def main():
N, A, B, C = map(int, input().split())
s_list = [input() for i in range(N)]
select_list = deque()
select_list.append('Yes')
for i, i_s in enumerate(s_list):
if i_s == 'AB':
if A == 0 and B == 0:
select_list = ... | import sys
from collections import deque
def main():
N, A, B, C = map(int, input().split())
s_list = [input() for i in range(N)]
select_list = deque()
select_list.append('Yes')
for i, i_s in enumerate(s_list):
if i_s == 'AB':
if A == 0 and B == 0:
select_list = ... | [
"identifier.change",
"control_flow.branch.if.condition.change",
"expression.operator.change"
] | 432,576 | 432,575 | u054871430 | python |
p02692 | n,a,b,c = map(int,input().split())
ans = []
S = []
for i in range(n):S.append(input())
for i in range(n):
s = S[i]
id = (i+1)%n
if s=="AB":
if a>b:
a-=1
b+=1
ans.append("B")
if a<b:
a+=1
b-=1
ans.append("A")
if a... | n,a,b,c = map(int,input().split())
ans = []
S = []
for i in range(n):S.append(input())
for i in range(n):
s = S[i]
id = (i+1)%n
if s=="AB":
if a>b:
a-=1
b+=1
ans.append("B")
elif a<b:
a+=1
b-=1
ans.append("A")
el... | [
"control_flow.branch.if.replace.remove",
"control_flow.branch.else_if.replace.add"
] | 432,589 | 432,590 | u401487574 | python |
p02692 | N,A,B,C=map(int,input().split())
S=['']*N
for a in range(N):
S[a]=input()
ans='Yes'
L_ans=['']*(N+1)
i=0
while i<N:
if S[i]=='AB':
if A>B:
B+=1
A-=1
L_ans[i]='B'
elif A<B:
A+=1
B-=1
L_ans[i]='A'
elif A==B and S[i+1]... | N,A,B,C=map(int,input().split())
S=['']*(N+1)
for a in range(N):
S[a]=input()
ans='Yes'
L_ans=['']*(N+1)
i=0
while i<N:
if S[i]=='AB':
if A>B:
B+=1
A-=1
L_ans[i]='B'
elif A<B:
A+=1
B-=1
L_ans[i]='A'
elif A==B and S[... | [] | 432,593 | 432,594 | u391819434 | python |
p02692 | N,A,B,C = map(int,input().split())
S = [input() for _ in range(N)]
ANS = ['']*N
for i in range(N):
if S[i]=='AB':
if A==0 and B==0:
print('No')
exit()
if i != N-1 and A==B and S[i+1]!='AB':
if S[i+1]=='AC':
ANS[i] = 'A'
A += 1
... | N,A,B,C = map(int,input().split())
S = [input() for _ in range(N)]
ANS = ['']*N
for i in range(N):
if S[i]=='AB':
if A==0 and B==0:
print('No')
exit()
if i != N-1 and A==B and S[i+1]!='AB':
if S[i+1]=='AC':
ANS[i] = 'A'
A += 1
... | [
"control_flow.branch.if.replace.remove",
"control_flow.branch.else_if.replace.add"
] | 432,702 | 432,703 | u698176039 | python |
p02693 | k=int(input())
a,b=map(int,input().split())
import math
if math.floor(b/k)-math.ceil(a/k)>=1:
print('OK')
else:
print('NG')
| k=int(input())
a,b=map(int,input().split())
import math
if math.floor(b/k)-math.ceil(a/k)>=0:
print('OK')
else:
print('NG')
| [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 432,823 | 432,824 | u487288850 | python |
p02693 | K = int(input())
A, B = map(int, input().split())
can_K_times = False
if (A % K) == 0 or (B % K) == 0:
can_K_times = True
elif (A / K) != (B / K):
can_K_times = True
if can_K_times:
print("OK")
else:
print("NG") | K = int(input())
A, B = map(int, input().split())
can_K_times = False
if (A % K) == 0 or (B % K) == 0:
can_K_times = True
elif (A // K) != (B // K):
can_K_times = True
if can_K_times:
print("OK")
else:
print("NG") | [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change"
] | 432,844 | 432,845 | u434191418 | python |
p02693 | K = int(input())
A, B = map(int, input().split())
can_K_times = False
if (A % K) == 0 or (A % K) == 0:
can_K_times = True
elif (A / K) != (B / K):
can_K_times = True
if can_K_times:
print("OK")
else:
print("NG") | K = int(input())
A, B = map(int, input().split())
can_K_times = False
if (A % K) == 0 or (B % K) == 0:
can_K_times = True
elif (A // K) != (B // K):
can_K_times = True
if can_K_times:
print("OK")
else:
print("NG") | [
"identifier.change",
"control_flow.branch.if.condition.change",
"expression.operator.arithmetic.change"
] | 432,846 | 432,845 | u434191418 | python |
p02693 | k = int(input())
a,b = map(int, input().sprit())
ans = 'NG'
for i in range(a,b+1) :
if i%k == 0 :
ans = 'OK'
print(ans)
| k = int(input())
a,b = map(int,input().split())
ans = 'NG'
for i in range(a,b+1) :
if i%k == 0 :
ans = 'OK'
print(ans)
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 432,852 | 432,853 | u276588887 | python |
p02693 | k=int(input())
a,b=map(int,input().split())
ans='NO'
for i in range(a,b+1):
if i%k==0:
ans='YES'
print(ans) | k=int(input())
a,b=map(int,input().split())
ans='NG'
for i in range(a,b+1):
if i%k==0:
ans='OK'
break
print(ans) | [
"literal.string.change",
"assignment.value.change",
"control_flow.break.add"
] | 432,856 | 432,857 | u653041271 | python |
p02693 | def main():
k = int(input())
a,b = map(int,input().split())
flag = 0
for i in range(a, b + 1):
if i % k == 0:
flag += 1
if flag > 0:
print('OK')
else:
print('NO')
main() | def main():
k = int(input())
a,b = map(int,input().split())
flag = 0
for i in range(a, b + 1):
if i % k == 0:
flag += 1
if flag > 0:
print('OK')
else:
print('NG')
main() | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,869 | 432,870 | u962609087 | python |
p02693 | k = int(input())
a, b = map(int, input().split())
for i in range(a, b + 1):
# print(i)
if i % k == 0:
print("OK")
exit()
print("No") | k = int(input())
a, b = map(int, input().split())
for i in range(a, b + 1):
# print(i)
if i % k == 0:
print("OK")
exit()
print("NG") | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,880 | 432,881 | u620238824 | python |
p02693 | K = int(input())
A,B = map(int, input().split())
if A % K == 0:
print('OK')
else:
if B % K ==0:
print('OK')
else:
if (A // K)*(K+1) <= B:
print('OK')
else:
print('NG')
| K = int(input())
A,B = map(int, input().split())
if A % K == 0:
print('OK')
else:
if B % K == 0:
print('OK')
else:
if (A // K+1)*K <= B:
print('OK')
else:
print('NG')
| [
"expression.operation.binary.remove",
"control_flow.branch.if.condition.change"
] | 432,884 | 432,885 | u528793636 | python |
p02693 | n=int(input())
j,k=map(int,input().split())
f=1
if k-j>=n:
print('OK')
f=0
else:
for i in range(j,k):
if i%n==0:
print('OK')
f=0
break
if f==1:
print("NG") | n=int(input())
j,k=map(int,input().split())
f=1
if k-j>=n:
print('OK')
f=0
else:
for i in range(j,k+1):
if i%n==0:
print('OK')
f=0
break
if f==1:
print("NG") | [
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.add"
] | 432,886 | 432,887 | u624281900 | python |
p02693 | def main():
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
if i%k == 0:
print("Yes")
return
print("No")
if __name__ == "__main__":
main() | def main():
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
if i%k == 0:
print("OK")
return
print("NG")
if __name__ == "__main__":
main() | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,888 | 432,889 | u906501980 | python |
p02693 | k = int(input())
a,b = list(map(int,input().split()))
ans = 'NG'
for i in range(a,b):
if i % k == 0:
ans = 'OK'
print(ans)
| k = int(input())
a,b = list(map(int,input().split()))
ans = 'NG'
for i in range(a,b+1):
if i % k == 0:
ans = 'OK'
print(ans)
| [
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.add"
] | 432,890 | 432,891 | u414376763 | python |
p02693 | k=int(input())
a,b=map(int,input().split())
x=b%k
y=b-x
if b-a>k:
print('OK')
elif y>a:
print('OK')
elif a==b and a%k==0:
print('OK')
else:
print('NG') | k=int(input())
a,b=map(int,input().split())
x=b%k
y=b-x
if b-a>k:
print('OK')
elif y>a:
print('OK')
elif a%k==0:
print('OK')
else:
print('NG') | [] | 432,895 | 432,896 | u956547804 | python |
p02693 | n = int(input())
a, b = map(int, input().split())
for i in range(10000):
if a <= n * i <= b:
print("OK")
break
else:
print("NO") | n = int(input())
a, b = map(int, input().split())
for i in range(10000):
if a <= n * i <= b:
print("OK")
break
else:
print("NG")
| [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,902 | 432,903 | u820351940 | python |
p02693 | k = int(input())
a,b = map(int, input().split())
for i in range(1,1000):
if a<= k*i <= b:
print("OK")
exit()
else:
pass
print("No") | k = int(input())
a,b = map(int, input().split())
for i in range(1,1000):
if a<= k*i <= b:
print("OK")
exit()
else:
pass
print("NG") | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,911 | 432,912 | u283751459 | python |
p02693 | K=int(input())
A,B=list(map(int, input().split()))
ans='No'
for i in range (A,B+1):
if i%K:
ans='OK'
break
print(ans) | K=int(input())
A,B=list(map(int, input().split()))
ans='NG'
for i in range (A,B+1):
if i%K==0:
ans='OK'
break
print(ans) | [
"literal.string.change",
"assignment.value.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 432,927 | 432,928 | u799428010 | python |
p02693 | k = int(input())
a, b = map(int, input().split())
if k - 1 <= b - a:
print("OK")
else:
for i in range(a, b + 1):
if i % k == 0:
print("OK")
break
else:
print("NO") | k = int(input())
a, b = map(int, input().split())
if k - 1 <= b - a:
print("OK")
else:
for i in range(a, b + 1):
if i % k == 0:
print("OK")
break
else:
print("NG") | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,932 | 432,933 | u040298438 | python |
p02693 | k = int(input())
a,b = map(int, input().split)
largest = (b//k)*k
print("OK" if largest >= a else "NG") | k = int(input())
a,b = map(int, input().split())
largest = (b//k)*k
print("OK" if largest >= a else "NG") | [
"call.add"
] | 432,941 | 432,942 | u239091426 | python |
p02693 | def main():
k = int(input())
a, b = map(int,input().split())
for i in range(a, b):
if i%k ==0:
print('OK')
return
print('NG')
return
main() | def main():
k = int(input())
a, b = map(int,input().split())
for i in range(a, b+1):
if i%k ==0:
print('OK')
return
print('NG')
return
main() | [
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.add"
] | 432,949 | 432,950 | u272457181 | python |
p02693 | k=int(input())
a,b = map(int,input().split())
while b>=a:
if b%k==0:
print('OK')
break
b-=1
if b<a:
print('NO') | k=int(input())
a,b = map(int,input().split())
while b>=a:
if b%k==0:
print('OK')
break
b-=1
if b<a:
print('NG') | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,953 | 432,954 | u486773779 | python |
p02693 | k=int(input())
a,b=map(int, input().split())
ok=False
for i in range(a, b+1):
ok = ok or i % k
print(['NG','OK'][ok]) | k=int(input())
a,b=map(int, input().split())
ok=False
for i in range(a, b+1):
ok = ok or (i % k == 0)
print(['NG','OK'][ok]) | [] | 432,955 | 432,956 | u926080943 | python |
p02693 | k = int(input())
a, b = map(int, input().split())
c = 1
for i in range(a, b + 1):
if i % k == 0:
c = 1
break
if c == 1:
print("OK")
else:
print("NG") | k = int(input())
a, b = map(int, input().split())
z = 0
for i in range(a, b+1):
if i%k == 0:
z = 1
break
if z == 1:
print("OK")
else:
print("NG") | [
"assignment.variable.change",
"identifier.change",
"literal.number.integer.change",
"assignment.value.change",
"control_flow.branch.if.condition.change"
] | 432,957 | 432,958 | u965482124 | python |
p02693 | k = int(input())
a, b = map(int, input().split())
c = 1
for i in range(a, b + 1):
if i % k == 0:
c = 1
break
if c == 1:
print("OK")
else:
print("NG") | k = int(input())
a, b = map(int, input().split())
c = 0
for i in range(a, b + 1):
if i % k == 0:
c = 1
break
if c == 1:
print("OK")
else:
print("NG") | [
"literal.number.integer.change",
"assignment.value.change"
] | 432,957 | 432,959 | u965482124 | python |
p02693 | K = int(input())
A, B = map(int, input().split())
large = (B // K) * K
print(large)
if A <= large:
print("OK")
else:
print("NG")
| K = int(input())
A, B = map(int, input().split())
large = (B // K) * K
if A <= large:
print("OK")
else:
print("NG")
| [
"call.remove"
] | 432,972 | 432,973 | u116484168 | python |
p02693 | K = int(input())
A, B = map(int, input().split())
large = (B // K) * K
if A <= large:
print("OK")
else:
print("NO")
| K = int(input())
A, B = map(int, input().split())
large = (B // K) * K
if A <= large:
print("OK")
else:
print("NG")
| [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,974 | 432,973 | u116484168 | python |
p02693 | K = int(input())
A, B = map(int, input().split())
large = (B / K) * K
if A <= large:
print("OK")
else:
print("NO")
| K = int(input())
A, B = map(int, input().split())
large = (B // K) * K
if A <= large:
print("OK")
else:
print("NG")
| [
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,975 | 432,973 | u116484168 | python |
p02693 | K = int(input())
A, B = map(int, input().split())
large = (B / K) * K
if A >= large:
print("OK")
else:
print("NO")
| K = int(input())
A, B = map(int, input().split())
large = (B // K) * K
if A <= large:
print("OK")
else:
print("NG")
| [
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 432,976 | 432,973 | u116484168 | python |
p02693 | k=int(input())
a,b=map(int,input().split())
for i in range(10000):
if a<=k*i<=b:
print("OK")
else:
pass
print("NG") | k=int(input())
a,b=map(int,input().split())
for i in range(10000):
if a<=k*i<=b:
print("OK")
exit()
else:
pass
print("NG") | [
"call.add"
] | 432,979 | 432,980 | u944886577 | python |
p02693 | k=int(input())
a,b=map(int,input().split())
for i in range(1000):
if a<=k*i<=b:
print("OK")
else:
pass
print("NG") | k=int(input())
a,b=map(int,input().split())
for i in range(10000):
if a<=k*i<=b:
print("OK")
exit()
else:
pass
print("NG") | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"call.add"
] | 432,981 | 432,980 | u944886577 | python |
p02692 | def solve():
ans = []
for i, (x, y) in enumerate(s):
if num[x]>num[y]: x, y = y, x
if num[x]==num[y] and i < n-1:
if y == s[i+1][0] or y == s[i+1][1]:
x, y = y, x
num[x]+=1
num[y]-=1
ans.append(x)
if num[y]<0: return False
return Tr... | def solve():
ans = []
for i, (x, y) in enumerate(s):
if num[x]>num[y]: x, y = y, x
if num[x]==num[y] and i < n-1:
if y == s[i+1][0] or y == s[i+1][1]:
x, y = y, x
num[x]+=1
num[y]-=1
ans.append(x)
if num[y]<0: return False
return an... | [
"function.return_value.change"
] | 432,989 | 432,990 | u310678820 | python |
p02692 | #!/usr/bin/env python3
import sys
input = sys.stdin.readline
n, a, b, c = map(int, input().split())
query = []
for _ in range(n):
s = input().rstrip()
query.append(s)
ans = []
for i, s in enumerate(query):
if s == "AB":
if a == 0 and b == 0:
print("No")
exit()
e... | #!/usr/bin/env python3
import sys
input = sys.stdin.readline
n, a, b, c = map(int, input().split())
query = []
for _ in range(n):
s = input().rstrip()
query.append(s)
ans = []
for i, s in enumerate(query):
if s == "AB":
if a == 0 and b == 0:
print("No")
exit()
e... | [
"control_flow.loop.for.condition.change",
"expression.operation.binary.remove"
] | 433,003 | 433,004 | u052499405 | python |
p02692 | n, *a = [int(i) for i in input().split()]
abc = "ABC"
xy = []
for _ in range(n):
xy.append([abc.index(i) for i in input()])
i = 0
ans = []
while i < n:
if a[xy[i][0]] == 1 and a[xy[i][1]] == 1:
j = list(set([0, 1, 2])-set(xy[i]))[0]
if i == n - 1 or a[j] != 0 or xy[i] == xy[i+1]:
if ... | n, *a = [int(i) for i in input().split()]
abc = "ABC"
xy = []
for _ in range(n):
xy.append([abc.index(i) for i in input()])
i = 0
ans = []
while i < n:
if a[xy[i][0]] == 1 and a[xy[i][1]] == 1:
j = list(set([0, 1, 2])-set(xy[i]))[0]
if i == n - 1 or a[j] != 0 or xy[i] == xy[i+1]:
if ... | [
"call.add"
] | 433,005 | 433,006 | u571969099 | python |
p02693 | K = int(input())
A, B = map(int, input().split())
if B // K * K >= A:
print('OK')
else:
print('NO')
| K = int(input())
A, B = map(int, input().split())
if B // K * K >= A:
print('OK')
else:
print('NG')
| [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 433,027 | 433,028 | u921156673 | python |
p02693 |
def main():
k = int(input())
a,b = list(map(int,input().split()))
for i in range(a,b):
if i%k == 0:
print('OK')
return
print('NG')
if __name__=='__main__':
main()
| def main():
k = int(input())
a,b = list(map(int,input().split()))
for i in range(a,b+1):
if i%k == 0:
return print('OK')
return print('NG')
if __name__=='__main__':
main()
| [
"control_flow.return.add"
] | 433,029 | 433,030 | u421674761 | python |
p02693 |
def main():
k = int(input())
a,b = list(map(int,input().split()))
for i in range(a,b):
if i%k == 0:
print('OK')
return
print('NG')
if __name__=='__main__':
main()
|
def main():
k = int(input())
a,b = list(map(int,input().split()))
for i in range(a,b+1):
if i%k == 0:
print('OK')
return
print('NG')
if __name__=='__main__':
main()
| [
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.add"
] | 433,029 | 433,031 | u421674761 | python |
p02693 | k=int(input())
a,b= map(int, input().split())
q=0
for i in range(1,1000):
if a<=k*i and k*i<=b:
print('OK')
q=1
if q==0:
print('NG') | k=int(input())
a,b= map(int, input().split())
q=0
for i in range(1,1000):
if a<=k*i and k*i<=b:
print('OK')
q=1
break
if q==0:
print('NG') | [
"control_flow.break.add"
] | 433,032 | 433,033 | u428341537 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.