Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02861 (python)

Fixed submission:
import math

N = int(input())
xy_list = []
for i in range(N):
    xy_list.append([int(i) for i in input().split()])
result = 0
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        city1 = math.pow(xy_list[i][0] - xy_list[j][0], 2)
        city2 = math.pow(xy_list[i][1] - xy_list[j][1], 2)
        result += math.sqrt(city1 + city2)
print("{:.10f}".format(result / N))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
xy_list = [0] * N
for i in range(N):
    xy_list.append(input().split())
result = 0
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        city1 = math.pow(xy_list[i][0] - xy_list[j][0], 2)
        city2 = math.pow(xy_list[i][1] - xy_list[j][1], 2)
        result += math.sqrt(city1 + city2)
print("{:.10f}".format(result / N))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
xy_list = [0] * N
for i in range(N):
    xy_list.append(input().split())
result = 0
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        city1 = math.pow(xy_list[i][0] - xy_list[j][0], 2)
        city2 = math.pow(xy_list[i][1] - xy_list[j][1], 2)
        result += math.sqrt(city1 + city2)
print(result / N)
Problem p02885 (python)

Fixed submission:
A, B = [int(i) for i in input().split()]
ret = A - B*2
print(ret if ret > 0 else 0)

Buggy submission (verdict: Runtime Error):
A, B = [int(i) for i in input().split())]
ret = A - B*2
print(ret if ret > 0 else 0)
Problem p02917 (python)

Fixed submission:
N = int(input())
B = [int(i) for i in input().split()][::-1]
ret = B[0] + B[N - 2]
for i in range(1, N - 1):
    ret += min(B[i - 1], B[i])
print(ret)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = [int(i) for i in input().split()][::-1]
#  N = 6
#  B = [0, 153, 10, 10, 23]
#  N = 3
#  B = [2, 5]
ans = 0
ans += B[1]  # A[1]
for i in range(0, N - 1):
    ans += min(B[i - 1], B[i])
print(ans)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = [int(i) for i in input().split()]
ans, prev, cnt = 0, 0, 0
for h in H:
    if h <= prev:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
    prev = h
print(max(ans, cnt))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [(int) i for i in input().split()]
moves = []
for i in range(N - 1):
    move = 0
    for j in range(i, N - 1):
        if H[j] >= H[j + 1]:
            move += 1
        else:
            break
    moves.append(move)
Problem p02946 (python)

Fixed submission:
K, X = [int(i) for i in input().split()]
l = K - 1
ans = " ".join([str(i) for i in list(range(X - l, X + l + 1))])
print(ans)

Buggy submission (verdict: Runtime Error):
K, X = [int(i) for i in input().split()]
ans = " ".join([str(i) for i in list(range(X - l, X + l + 1))])
print(ans)
Problem p02947 (python)

Fixed submission:
N = int(input())
S = [input() for _ in range(N)]
d = {}
ans = 0
for s in S:
    ss = "".join(sorted(s))
    if ss in d:
        d[ss] += 1
        ans += d[ss]
    else:
        d[ss] = 0
print(ans)

Buggy submission (verdict: Runtime Error):
N = [int(i) for i in input().split()]
S = []
d = {}
for i in range(N):
    S.append(input())
for s in S:
    new_s = "".join((sorted(s)))
    if new_s in d:
        d[new_s] += d[new_s]
    else:
        d[new_s] = 1
print(max(d.values()))
Problem p02983 (python)

Fixed submission:
L, R = [int(i) for i in input().split()]
R = min(R, L + 4038)
ans = 2018
for i in range(L, R + 1):
    for j in range(i + 1, R + 1):
        x = (i * j) % 2019
        if x == 0:
            ans = 0
            break
        ans = min(ans, x)
print(ans)

Buggy submission (verdict: Runtime Error):
L, R = [int(input()) for i in input().split()]
diff = R - L
ans = 2019
if diff == 1:
    x = (L * (L + 1)) % 2019
    print(min(x, ans))
else:
    for i in range(diff):
        for j in range(i + 1, diff):
            x = ((L + i) * (L + j)) % 2019
            ans = min(x, ans)
            if x == 0:
                break
    print(ans)

Buggy submission (verdict: Runtime Error):
L, R = [int(input()) for i in input().split()]
diff = R - L
ans = 2 * (10 ** 9)
if diff == 1:
    print((L * (L + 1)) % 2019)
else:
    for i in range(diff):
        for j in range(i + 1, diff):
            x = ((L + i) * (L + j)) % 2019
            ans = min(x, ans)
            if x == 0:
                break
    print(ans)

Buggy submission (verdict: Runtime Error):
L, R = [int(input()) for i in input().split()]
diff = R - L
ans = 2019
if diff == 1:
    print((L * (L + 1)) % 2019)
else:
    for i in range(diff):
        for j in range(i + 1, diff):
            x = ((L + i) * (L + j)) % 2019
            ans = min(x, ans)
            if x == 0:
                break
    print(ans)

Buggy submission (verdict: Runtime Error):
L, R = [int(input()) for i in input().split()]
diff = R - L
ans = 2019
if diff == 1:
    print((L * (L + 1)) % 2019)
else:
    for i in range(diff):
        for j in range(i + 1, diff):
            x = ((L + i) * (L + j)) % 2019
            ans = min(x, ans)
            if x == 0:
                break
    print(ans)
Problem p03681 (python)

Fixed submission:
from math import factorial

n, m = [int(i) for i in input().split()]
mod = 10 ** 9 + 7

ans = 0
diff = abs(n - m)
if diff == 0:
    ans = (factorial(n) ** 2) * 2 % mod
elif diff == 1:
    ans = factorial(n) * factorial(m) % mod
print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial

n, m = [int(i) for i in input().split()]
mod = 10e9 + 7

ans = 0
diff = abs(n - m)
if diff == 0:
    ans = (factorial(n) ** 2) * 2 % mod
elif diff == 1:
    ans = factorial(n) * factorial(m) % mod
print(ans)
Problem p03721 (python)

Fixed submission:
n, k = [int(i) for i in input().split()]
cnt = [0] * int(10e5)
for i in range(n):
    a, b = [int(i) for i in input().split()]
    cnt[a] += b

for i in range(1, len(cnt)):
    if k <= cnt[i]:
        print(i)
        break
    k -= cnt[i]

Buggy submission (verdict: Runtime Error):
n, k = [int(i) for i in input().split()]
d = {}
for i in range(n):
    a, b = [int(i) for i in input().split()]
    if a in d:
        d[a] += b
    else:
        d[a] = b
c = []
for k, v in sorted(d.items(), key=lambda x: x[0]):
    c += [k] * v
print(c[k])
Problem p03944 (python)

Fixed submission:
w, h, n = [int(i) for i in input().split()]
W = set(range(w))
H = set(range(h))
for i in range(n):
    x, y, a = [int(i) for i in input().split()]
    if a == 1:
        W &= set(range(x, w))
    elif a == 2:
        W &= set(range(0, x))
    elif a == 3:
        H &= set(range(y, h))
    elif a == 4:
        H &= set(range(0, y))
print(len(W) * len(H))

Buggy submission (verdict: Runtime Error):
w, h, n = [int(i) for i in input().split()]
w2, h2 = w, h
wb, hb = [False] * w, [False] * h
for i in range(n):
    x, y, a = [int(i) for i in input().split()]
    if a == 1 and not wb[x]:
        w2 -= x
        wb[x] = True
    elif a == 2 and not wb[x]:
        w2 -= w - x
        wb[x] = True
    elif a == 3 and not hb[y]:
        h2 -= y
        hb[y] = True
    elif a == 4 and not hb[y]:
        h2 -= h - y
        hb[y] = True
ans = w2 * h2
print(ans if ans > 0 else 0)
Problem p02553 (python)

Fixed submission:
a,b,c,d=map(int,input().split())

print(max(a*c,a*d,b*c,b*d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

print(max(a*c,a*d,b*c
Problem p02554 (python)

Fixed submission:
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

n = r()
tens=1
nines=1
eights=1
mod = 10**9+7
for i in range(n):
    tens=(tens*10)%mod
    nines=(nines*9)%mod
    eights=(eights*8)%mod
print((tens-2*nines+eights)%mod)

Buggy submission (verdict: Runtime Error):
n = r()
tens=1
nines=1
eights=1
mod = 10**9+7
for i in range(n):
    tens=(tens*10)%mod
    nines=(nines*9)%mod
    eights=(eights*8)%mod
print((tens-2*nines+eights)%mod)
Problem p02555 (python)

Fixed submission:
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

'''D Redistribution'''
mod=10**9+7
n = r()
ans = [0]*(n+1)
dp = [0]*(n+1)
ans[0]=1
dp[0]=1
if n>=1:
    dp[1]=1
if n>=2:
    dp[2]=1
for i in range(3,n+1):
    ans[i]=dp[i-3]
    dp[i]=(dp[i-1]+ans[i])%mod
print(ans[-1])

Buggy submission (verdict: Runtime Error):
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

'''D Redistribution'''
mod=10**9+7
n = r()
ans = [0]*(n+1)
dp = [0]*(n+1)
ans[0]=1
dp[0]=dp[1]=dp[2]=1
for i in range(3,n+1):
    ans[i]=dp[i-3]
    dp[i]=(dp[i-1]+ans[i])%mod
print(ans[-1])
Problem p02614 (python)

Fixed submission:
import sys
import math
import heapq
from collections import defaultdict, deque
from decimal import *
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))
mod=1000000007

H,W,k=rm()
a=[list(input()) for i in range(H)]
ans=0
for h in range(1<<H):
    for w in range(1<<W):
        count=0
        for i in range(H):
            for j in range(W):
                if (a[i][j]!='#'):
                    continue
                if h>>i&1!=0 or w>>j&1!=0:
                    continue
                count+=1
        if count==k:
            ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
H,W,k=rm()
a=[list(input()) for i in range(H)]
ans=0
for h in range(1<<H):
    for w in range(1<<W):
        count=0
        for i in range(H):
            for j in range(W):
                if (a[i][j]!='#'):
                    continue
                if h>>i&1!=0 or w>>j&1!=0:
                    continue
                count+=1
        if count==k:
            ans+=1
print(ans)
Problem p02616 (python)

Fixed submission:
MOD = 10**9+7
N,K = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse = True)
ans = 1
if A[-1] >= 0:
    for i in range(K):
        ans *= A[i]
        ans %= MOD
elif A[0] < 0:
    if K % 2 == 0:
        for i in range(K):
            ans *= A[N-1-i]
            ans %= MOD
    else:
        for i in range(K):
            ans *= A[i]
            ans %= MOD
else:
    r,l = N-1,0
    n = 0
    while n < K:
        if K-n == 1:
            ans *= A[l]
            ans %= MOD
            n += 1
        else:
            if A[r]*A[r-1] > A[l]*A[l+1]:
                ans *= (A[r]*A[r-1])
                ans %= MOD
                r -= 2
                n += 2
            else:
                ans *= A[l]
                ans %= MOD
                l += 1
                n += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import math
import heapq
from collections import defaultdict, deque
from decimal import *
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))
mod=1000000007

'''E Multiplication 4'''
n,k=rm()
a=rl()
pos=[]
neg=[]
for i in a:
    if i>=0:
        pos.append(i)
    elif i<0:
        neg.append(i)

pos.sort(reverse=True)
neg.sort()
negg=[::-1]

for i in range(1,len(pos)):
    pos[i]=(pos[i-1]*pos[i])
for j in range(1,len(neg)):
    neg[j]=(neg[j-1]*neg[j])
    negg[j]=(negg[j-1]*negg[j])

if len(pos)==0:
    if k%2==0:
        print(neg[k-1]%mod)
    else:
        print(negg[k-1]%mod)
elif len(neg)==0:
    print(pos[k-1]%mod)
else:
    maxi=-math.inf
    for i in range(0,k+1,2):
        if i==0:
            if k-i<=len(pos):
                maxi=max(maxi,pos[k-i-1])
        elif k-i==0:
            if i<=len(neg):
                maxi=max(maxi,neg[i-1])
        elif i<=len(neg) and k-i<=len(pos):
            maxi=max(maxi,neg[i-1]*pos[k-i-1])
    print(maxi)
Problem p02909 (python)

Fixed submission:
S = input()
if S =="Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
S = input()
if S =="Sunny":
  print("Cloudy")
elif:
  print("Rainy")
else:
  print("Sunny")
Problem p02934 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

s=0
for i in A:
  s += 1/i
print(1/s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

s=0
for i in A:
  s += 1/A
print(1/s)

Buggy submission (verdict: Runtime Error):
N = int(input().split())
A = list(map(int, input().split()))

s=0
for i in A:
  s += 1/A
print(1/s)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))

D = 0
ans = 1
for i in range(N):
  D = D + L[i]
  if D <= X:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))

D = 0

for i in range(N):
  D = D + L[i]
  if D > X:
    ans = i+1
    break
print(ans)
Problem p03061 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

import fractions
import copy
from functools import reduce

#最大公約数を求める関数
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

l = []
sorted_A = sorted(A)
ind = 0
for i in range(1, len(A)):
    if gcd_list([sorted_A[0], sorted_A[i]]) == 1:
        ind = i
        break
if ind == 0:
    ind = 1
for i in [0,ind]:
    sorted_A = sorted(A)
    del sorted_A[i]
    l.append(gcd_list(sorted_A))

print(max(l))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

import math
import copy
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

ans = 1
temp_A = A
for i in range(N):
    temp_A = copy.deepcopy(A)
    del temp_A[i]
    ans = max(ans, gcd_list(temp_A))

print(ans)
Problem p03136 (python)

Fixed submission:
N = int(input())
L = []
L = list(map(int, input().split()))

M = max(L)
L.remove(M)
if M < sum(L):
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = []
L = list(map(int, input().split()))

M = max(L)
L2 = L.remove(M)
if M < sum(L2):
	print('Yes')
else:
	print('No')
Problem p03213 (python)

Fixed submission:
N = int(input())
import itertools

def divisor_pl(num):
    l = []
    i = 2
    while num > 1:
        if num%i == 0:
            l.append(i)
            num = int(num/i)
            i = 2
        else:
            i += 1
    if num != 1:
        l.append(num)
    return l

l = []
for i in range(2,N+1):
    l.append(divisor_pl(i))
l = sum(l,[])
l.sort()

fac_dict = {}
fac_list = []
for key, value in itertools.groupby(l):
    fac_dict[str(key)] = len(list(value))
    fac_list.append(key)

count = 0
#(4,4,2)型のカウント
for l in itertools.combinations(fac_list,3):
    for i in range(3):
        if fac_dict[str(l[i%3])] >= 4 and fac_dict[str(l[(i+1)%3])] >= 4 and fac_dict[str(l[(i+2)%3])] >= 2:
            count+=1

#(14,4)型のカウント
for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 14 and fac_dict[str(l[(i+1)%2])] >= 4:
            count+=1

#(24,2)型のカウント
for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 24 and fac_dict[str(l[(i+1)%2])] >= 2:
            count+=1

#(74)型のカウント
for l in fac_list:
    if fac_dict[str(l)] >= 74:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
import itertools

l = []
for i in range(2,N+1):
    l.append(divisor_pl(i))
l = sum(l,[])
l.sort()

fac_dict = {}
fac_list = []
for key, value in itertools.groupby(l):
    fac_dict[str(key)] = len(list(value))
    fac_list.append(key)

count = 0
#(4,4,2)型のカウント
exp_list = []
for l in itertools.combinations(fac_list,3):
    a = []
    for i in range(3):
        a.append(fac_dict[str(l[i])])
    exp_list.append(a)

for l in exp_list:
    if all(i>=2 for i in l) and sum(i>=4 for i in l) >=2:
        count += 1

#(14,4)型のカウント
exp_list = []
for l in itertools.combinations(fac_list,2):
    a = []
    for i in range(2):
        a.append(fac_dict[str(l[i])])
    exp_list.append(a)

for l in exp_list:
    if all(i>=4 for i in l) and sum(i>=14 for i in l) >=1:
        count += 1

#(24,2)型のカウント
exp_list = []
for l in itertools.combinations(fac_list,2):
    a = []
    for i in range(2):
        a.append(fac_dict[str(l[i])])
    exp_list.append(a)

for l in exp_list:
    if all(i>=2 for i in l) and sum(i>=24 for i in l) >=1:
        count += 1

#(74)型のカウント
exp_list = []
for l in fac_list:
    exp_list.append(fac_dict[str(l)])

for l in exp_list:
    if l >= 74:
        count += 1
print(count)
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = []
H = list(map(int,input().split()))

l = []
for i in range(N):
    l.append(abs(A - (T - 0.006 * H[i])))
print(l.index(min(l))+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = []
for i in range(N):
  H.append(input())

l = []
for i in range(N):
    l.append(abs(A - (T - 0.006 * H[i])))
print(l.index(min(l))+1)
Problem p03243 (python)

Fixed submission:
N = input()
x = N[0]
xxx = int(3*x)
if int(N) <= xxx:
  print(xxx)
else:
  x = int(x)+1
  print(100*x + 10*x + x)

Buggy submission (verdict: Runtime Error):
N = input()
x = N[0]
xxx = int(3*x)
if N <= XXX:
  print(xxx)
else:
  x = int(x)+1
  print(100*x + 10*x + x)
Problem p03288 (python)

Fixed submission:
R = int(input())
if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')

Buggy submission (verdict: Runtime Error):
R = int(input())
if R < 1200:
  print('ABC')
else if R < 2800:
  print('ARC')
else:
  print('AGC')
Problem p03351 (python)

Fixed submission:
a, b, c, d = map(int, input().split())

ab = abs(a-b)
bc = abs(b-c)
ac = abs(a-c)

if ac <= d or (ab <= d and bc <= d):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())

ab = abs(a-b)
bc = abs(b-c)
ac = abc(a-c)

if ac <= d or (ab <= d and bc <= d):
  print('Yes')
else:
  print('No')
Problem p03469 (python)

Fixed submission:
S = input()
print("2018" + S[4:len(S)])

Buggy submission (verdict: Runtime Error):
S = input()
S[0:4]="2018"
print(S)
Problem p03474 (python)

Fixed submission:
A, B = map(int, input().split())
S = input()
if S[0:A].isdigit() and S[A]== "-" and S[A+1:A+B+1].isdigit():
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())
S = input()
if S[0:A].isdigit()==True and S[A]== "-" and S[A+1:A+B+1]:
  print("Yes")
else:
  print("No")
Problem p02817 (python)

Fixed submission:
S,T = input().split()

print(T + S)

Buggy submission (verdict: Runtime Error):
S = inout()
T = input()

print(T + S)
Problem p02639 (python)

Fixed submission:
n = [int(x) for x in input().split()]
for i in range(len(n)):
  if n[i] == 0:
    print(i + 1)
    break

Buggy submission (verdict: Runtime Error):
n = list(map(int,input().split()))
for i in range(n):
  if n[i] == 0:
    print(i)
    break
Problem p02641 (python)

Fixed submission:
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
  for s in [-1, +1]:
    a = X + s * d
    if p.count(a) == 0:
      print(a)
      exit(0)

Buggy submission (verdict: Runtime Error):
x,n = [int(x) for x in input().split()]
if n == 0:
  print(x)
else:
  p = [int(x) for x in input().split()]
  p.sort()
  ans = []
  for i in range(1,101):
    if i in p:
      continue
    b = abs(x - i)
    ans.append([i,b])
  ans = sorted(ans,key = lambda x: x[1])
  #print(ans)
  print(ans[0][0])

Buggy submission (verdict: Runtime Error):
x,n = [int(x) for x in input().split()]
if n == 0:
  print(x)
else:
  p = [int(x) for x in input().split()]
  p.sort()
  ans = []
  for i in range(1,101):
    if i in p:
      continue
    b = abs(x - i)
    ans.append((i,b))
  ans = sorted(ans,key = lambda x: x[1])
  #print(ans)
  print(ans[0][0])

Buggy submission (verdict: Runtime Error):
x,n = [int(x) for x in input().split()]
if n == 0:
  print(x)
else:
  p = [int(x) for x in input().split()]
  p.sort()
  ans = []
  for i in range(1,101):
    if i in p:
      continue
    b = abs(x - i)
    ans.append((i,b))
  ans = sorted(ans,key = lambda x: x[1])
  print(ans)
  print(ans[0][0])
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
n = len(s)
if s == t[:n]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
n = len(s)
if s = t[:n]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
n = len(s)
if s = t[:n-1]:
  print("Yes")
else:
  print("No")
Problem p02760 (python)

Fixed submission:
a = [[0] * 3 for x in range(3)]
s = [[0] * 3 for x in range(3)]
for i in range(3):
  a[i] = [int(x) for x in input().split()]
n = int(input())
b = []
for i in range(n):
  b.append(int(input()))
for i in range(n):
  for j in range(3):
    for k in range(3):
      if b[i] == a[j][k]:
        s[j][k] = 1
res = "No"
if s[0][0] == 1 and s[0][1] == 1 and s[0][2] == 1:
  res = "Yes"
if s[1][0] == 1 and s[1][1] == 1 and s[1][2] == 1:
  res = "Yes"
if s[2][0] == 1 and s[2][1] == 1 and s[2][2] == 1:
  res = "Yes"
if s[0][0] == 1 and s[1][0] == 1 and s[2][0] == 1:
  res = "Yes"
if s[0][1] == 1 and s[1][1] == 1 and s[2][1] == 1:
  res = "Yes"
if s[0][2] == 1 and s[1][2] == 1 and s[2][2] == 1:
  res = "Yes"
if s[0][0] == 1 and s[1][1] == 1 and s[2][2] == 1:
  res = "Yes"
if s[2][0] == 1 and s[1][1] == 1 and s[0][2] == 1:
  res = "Yes"
print(res)

Buggy submission (verdict: Runtime Error):
a = [[0] * 3 for x in range(3)]
s = [[0] * 3 for x in range(3)]
for i in range(3):
  a[i] = [int(x) for x in input().split()]
n = int(input())
b = []
for i in range(n):
  b.append(int(input()))
for i in range(n):
  for j in range(3):
    for k in range(3):
      if b[i] == a[j][k]:
        s[j][k] = 1
res = "No"
if s[0][0] == 1 and s[0][1] == 1 and s[0][2] == 1:
  res = "Yes"
if s[1][0] == 1 and s[1][1] == 1 and s[1][2] == 1:
  res = "Yes"
if s[2][0] == 1 and s[2][1] == 1 and s[3][2] == 1:
  res = "Yes"
if s[0][0] == 1 and s[1][0] == 1 and s[2][0] == 1:
  res = "Yes"
if s[0][1] == 1 and s[1][1] == 1 and s[2][1] == 1:
  res = "Yes"
if s[0][2] == 1 and s[1][2] == 1 and s[2][2] == 1:
  res = "Yes"
if s[0][0] == 1 and s[1][1] == 1 and s[2][2] == 1:
  res = "Yes"
if s[2][0] == 1 and s[1][1] == 1 and s[0][2] == 1:
  res = "Yes"
print(res)
Problem p02778 (python)

Fixed submission:
s = input()
a = ""
for i in range(len(s)):
  a += "x"
print(a)

Buggy submission (verdict: Runtime Error):
s = input()
for i in range(len(s)):
  s[i] = "x"
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
for i in range(len(s)):
  s[i] = x
print(s)
Problem p02830 (python)

Fixed submission:
n = int(input())
s,t = input().split()
ans = ""
for i in range(n):
  ans += s[i] + t[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s,t = input().split()
ans = ""
for i in range(n):
  ans += a[i] + b[i]
print(ans)
Problem p02848 (python)

Fixed submission:
n = int(input())
s = list(input())
for i in range(len(s)):
  s[i] = chr((ord(s[i])-65+n) % 26 + 65)
print("".join(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
for i in range(len(s)):
  s[i] = chr(ord((s[i]-65+n) % 26 + 65))
print(s)
Problem p03251 (python)

Fixed submission:
n,m,x,y = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
max_x = max(a)
min_y = min(b)
max_x = max(max_x,x)
min_y = min(min_y,y)

if max_x < min_y:
  print("No War")
else:
  print("War")

Buggy submission (verdict: Runtime Error):
n,m,x,y = map(list(input().split()))
a = map(list(input().split()))
b = map(list(input().split()))
max_x = max(a)
max_y = max(b)
max_x = max(max_x,x)
max_y = max(max_y,y)

if max_x < max_y:
  print("No War")
else:
  print("War")