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

Fixed submission:
s=input()
even = ["L","U","D"]
odd = ["R", "U", "D"]
f = False
for i in range(len(s)):
  if i%2:
    if s[i] not in even:
      f = True
  else:
    if s[i] not in odd:
      f = True
if f:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s=input()
even = ["L","U","D"]
odd = ["R", "U", "D"]
f = false
for i in range(len(s)):
  if i%2:
    if s[i] not in even:
      f = True
  else:
    if s[i] not in odd:
      f = True
if f:
  print("No")
else:
  print("Yes")
Problem p02969 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    r = I()
    print(3 * r * r)

main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    r = I()
    print(3 * a * a)

main()
Problem p02981 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n, a, b = LI()
    print(min(a*n, b))

main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
	n, a, b = LI()
    print(min(n*a, b))

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
	n, a, b = LI()
    print(min(n*a, b))

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
	n, a, b = LI()
    print(n*a, b)
Problem p02995 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque


from fractions import gcd

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
    
def lcm(x, y):
    return (x * y) // gcd(x, y)

def main():
    a,b,c,d = LI()
    c_d_gcd = lcm(c,d)
    s = b//c + b//d - b//c_d_gcd
    t = (a-1) // c + (a-1) // d - (a-1) // c_d_gcd
    print(b - a + 1 - (s-t))
main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
    
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def main():
    a,b,c,d = LI()
    c_d_gcd = lcm(c,d)
    s = b//c + b//d - b//c_d_gcd
    t = (a-1) // c + (a-1) // d - (a-1) // c_d_gcd
    print(b - a + 1 - (s-t))
main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
    
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


def main():
    a,b,c,d = LI()
    c_d_gcd = lcm(c,d)
    s = b//c + b//d - b//c_d_gcd
    t = (a-1) // c + (a-1) // d - (a-1) // c_d_gcd
    print(b - a + 1 - (s-t))
main()
Problem p03128 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, M = LI()
    A = LI()
    num2match = {
        1: 2,
        2: 5,
        3: 5,
        4: 4,
        5: 5,
        6: 6,
        7: 3,
        8: 7,
        9: 6,
    }
    dp = ['' for _ in range(N+1)]
    for a in A:
        match_need = num2match[a]
        if 0 <= match_need <= N:
            dp[match_need] = max(str(dp[match_need]), str(a))
    for i in range(N+1):
        for a in A:
            match_need = num2match[a]
            if i - match_need > 0:
                if dp[i-match_need] == '':
                    continue
                old = dp[i]
                new = str(a) + dp[i-match_need]
                if len(old) > len(new):
                    dp[i] = old
                elif len(new) > len(old):
                    dp[i] = new
                else:
                    dp[i] = max(old, new)
    print(dp[N])
main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, M = LI()
    A = LI()
    num2match = {
        1: 2,
        2: 5,
        3: 5,
        4: 4,
        5: 5,
        6: 6,
        7: 3,
        8: 7,
        9: 6,
    }
    dp = ['' for _ in range(N+1)]
    for a in A:
        match_need = num2match[a]
        dp[match_need] = max(str(dp[match_need]), str(a))
    for i in range(N+1):
        for a in A:
            match_need = num2match[a]
            if i - match_need > 0:
                if dp[i-match_need] == '':
                    continue
                old = dp[i]
                new = str(a) + dp[i-match_need]
                if len(old) > len(new):
                    dp[i] = old
                elif len(new) > len(old):
                    dp[i] = new
                else:
                    dp[i] = max(old, new)
    print(dp[N])
main()
Problem p03264 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    K = I()
    a = K // 2
    b = K - a
    print(a*b)

main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    K = I()
    a == K // 2
    b = K - a
    print(a*b)

main()
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=input()
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Buggy submission (verdict: Runtime Error):
r = input()
if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")
Problem p03289 (python)

Fixed submission:
s = input()
smalls = "abcdefghijklmnopqrstuvwxyz"
def solve(s):
    count = 0
 
    if s[0] != "A":
        return False
 
    if s[1] not in smalls:
        return False
    for char in s[2:-1]:
        if char == "C":
            count += 1
            continue
 
        if char not in smalls:
            return False
    if count != 1:
        return False
    if s[-1] not in smalls:
	    return False
    return True
 
if solve(s):
    print("AC")
else:
    print("WA")

Buggy submission (verdict: Runtime Error):
s = input()
smalls = "abcdefghijklmnopqrstuvwxyz".split()
def solve(s):
    count = 0
    if s[0] != "A":
        return False
    if s[1] not	in smalls:
	return False
    for char in s[2:]:
	if char	not in smalls:
            return False
	if char	== "C":
            count += 1
    if count !=	1:
	return False
    return True

if solve(s):
    print("AC")
else:
    print("WA")
Problem p03361 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    s = []
    H, W = LI()
    for i in range(H):
        _s = S()
        s.append(_s)
    for r in range(H):
        for c in range(W):
            if s[r][c] == '.':
                continue
            any_tonari_black = False
            for dr, dc in zip(DR, DC):
                new_r = r + dr
                new_c = c + dc
                if not (0 <= new_r < H and 0 <= new_c < W):
                    continue
                if s[new_r][new_c] == '#':
                    any_tonari_black = True
            if not any_tonari_black:
                print('No')
                return
    print('Yes')
main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    s = []
    H, W = LI()
    for i in range(H):
        _s = S()
        s.append(_s)
    for i in range(W):
        for j in range(H):
            if s[i][j] == '.':
                continue
            any_tonari_black = False
            for dr, dc in zip(DR, DC):
                new_i = i + dr
                new_j = j + dc
                if not (0 <= new_i < W and 0 <= new_j < H):
                    continue
                if s[new_i][new_j] == '#':
                    any_tonari_black = True
            if not any_tonari_black:
                print('No')
                return
    print('Yes')
main()
Problem p03371 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    A, B, C, X, Y = LI()
    if X > Y:
        X, Y = Y, X
        A, B = B, A
    money_a_b = X * A + Y * B
    money_b_c = (Y - X) * B + (2 * X) * C
    money_c = Y * 2 * C
    ans = min(money_a_b, money_b_c, money_c)
    print(ans)

main()

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int, raw_input().split())
ans = min(a*x + b*y, min(2*c*max(x,y), 2*c*min(x,y) + (x-y)*a if x>y else 2*c*min(x,y) + (y-x)*b))
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int, raw_input().split())
ans = min(a*x + b*y, min(2*c*max(x,y), 2*c*min(x,y) + (x-y)*a if x>y else 2*c*min(x,y) + (y-x)*b))
print(ans)
Problem p03417 (python)

Fixed submission:
N, M = map(int, input().split())
ans = 0
if N > 1 and M > 1:
    ans = (N-2) * (M-2)

elif N==1 and M==1:
    ans = 1
else:
    ans = max(N, M) - 2
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ans = 0
if N > 1 and M > 1:
    ans = (N-2) * (M-2)

elif:
    ans = 1
else:
    ans = max(N, M) - 2
print(ans)
Problem p03633 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def lcm(a, b):
    gcd = fractions.gcd
    n_gcd = gcd(a, b)
    return a * b // n_gcd

def main():
    N = I()
    T = []
    for _ in range(N):
        T.append(I())
    n_lcm = lcm(T[0], T[0])
    for i in range(1, N):
        n_lcm = lcm(n_lcm, T[i])
    print(n_lcm)
main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def lcm(a, b):
    gcd = fractions.gcd
    n_gcd = gcd(a, b)
    return a * b // n_gcd

def main():
    N = I()
    T = []
    for _ in range(N):
        T.append(I())
    n_lcm = lcm(T[0], T[1])
    for i in range(2, N):
        n_lcm = lcm(n_lcm, T[i])
    print(n_lcm)
main()
Problem p03993 (python)

Fixed submission:
N = input()
a = raw_input().split()
ans = 0
for i in xrange(N):
    target = int(a[i]) - 1
    if int(a[target]) == i+1:
       ans += 1
print ans/2

Buggy submission (verdict: Runtime Error):
N = input()
a = raw_input().split()
ans = 0
for i in xrange(N):
    if a[ a[i] - 1 ] == i+1:
       ans += 1
print ans
Problem p02678 (python)

Fixed submission:
print('Yes')

from collections import deque  

n, m = map(int, input().split())
graph = [[] for _ in range(n+1)]

for i in range(m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
#print(graph)

ans = [-1] * (n+1)
ans[0] = 0
ans[1] = 0

d = deque()
d.append(1)

while d:
    v = d.popleft()
    for i in graph[v]:
        if ans[i] != -1:
            continue
        ans[i] = v
        d.append(i)

print(*ans[2:], sep="\n")

Buggy submission (verdict: Runtime Error):
import numpy as np
n,m=map(int,input().split())
r=np.array([list(map(int,input().split())) for _ in range(m)])
start=np.array([1])
done=np.array([1])
ans=np.array([-1]*n)

for _ in range(n-1):
    start_tmp=np.array([])
    for st in start:
        r_st = r[np.any(r==st, axis=1)].flatten()
        r_gl = np.setdiff1d(np.delete(r_st, np.where(r_st == st)), done)
        
        start_tmp=np.unique(np.append(start_tmp, r_gl))
        done=np.unique(np.append(done, r_gl))
        #print(r_gl)
        ans[r_gl-1] = st
        
    start = start_tmp
    #print(ans)
    #print(start, done)
    
    if len(done)==n:
        break
    
print('Yes')
print('\n'.join(map(str, ans[1:])))
Problem p02687 (python)

Fixed submission:
s = input()
if s[1] == 'B':
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
s = int(input())
if s[1] == 'B':
  print('ARC')
else:
  print('ABC')
Problem p02732 (python)

Fixed submission:
import collections
import numpy as np

n = int(input())
li = list(map(int, input().split()))

di = collections.Counter(li)
#print(di)

arr = np.array(list(di.values()))
arrr = arr - 1
c = np.dot(arr, arrr) // 2
#print(c)

#(n * n-1)-(n-1 * n-2) / 2 = n-1

for v in li:
    x = int(di[v])
    if x == 1:
        print(c)
    else:
        print(c-(x-1))

Buggy submission (verdict: Runtime Error):
import collections
import numpy as np

n = int(input())
li = list(map(int, input().split()))

di = collections.Counter(li)
#print(di)

arr = np.array(list(di.values()))
arrr = arr - 1
c = np.dot(arr, arrr) // 2
#print(c)

for v in li:
    x = int(di[v])
    if x == 1:
        print(c)
    else:
        print(c-(x-1))
    
#(n * n-1)-(n-1 * n-2) / 2
Problem p02760 (python)

Fixed submission:
# coding: utf-8
import numpy as np

card = np.array([list(map(int, input().split())) for _ in range(3)])
n = int(input())

for _ in range(n):
    num = int(input())
    if num in card:
        pos = tuple(nd[0] for nd in np.where(card == num))
        card[pos[0], pos[1]] = 0

f = 0

for i in range(3):
    if sum(card[i,:]) == 0 or sum(card[:,i]) == 0:
        f = 1
    if card[0,0]+card[1,1]+card[2,2] == 0 or card[2,0]+card[1,1]+card[2,0] == 0:
        f = 1

if f:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# coding: utf-8
import numpy as np

card = np.array([list(map(int, input().split())) for _ in range(3)])
n = int(input())

for _ in range(n):
    num = int(input())
    if num in card:
        pos = tuple(nd[0] for nd in np.where(card == num))
        card[pos[0], pos[1]] = 0

f = 0

for i in range(3):
    if sum(card[i,:]) == 0 or sum(card[:,i]) == 0:
        f = 1
    if card[0,0]+card[1,1]+card[2,2] == 0 or card[2,0]+card[1,1]+card[2,0] == 0:
        f = 1

if f:
    print('Yes')
else:
    print('No')
Problem p02761 (python)

Fixed submission:
# coding: utf-8

f = 1
n, m = map(int, input().split())

li = [-1] * n

for _ in range(m):
    s, c = map(int, input().split())
    if li[s-1] != -1 and li[s-1] != c:
        f = 0
        break
    else:
        li[s-1] = c

if n > 1 and li[0] == 0:
    f = 0
else:
    if -1 in li and li.index(-1) == 0:
        if n > 1:
            li[0] = 1
        else:
            li[0] = 0
    while -1 in li:
        li[li.index(-1)] = 0

if f:
    for i in range(n):
        print(li[i], end='')
    print('')
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
# coding: utf-8
import numpy as np

f = 1
n, m = map(int, input().split())

li = [-1] * n

for _ in range(m):
    s, c = map(int, input().split())
    if li[s-1] != -1 and li[s-1] != c:
        f = 0
        break
    else:
        li[s-1] = c

if li[0] == -1 or li[0] == 0:
    f = 0
else:
    while -1 in li:
        li[li.index(-1)] = 0

if f:
    for i in range(n):
        print(li[i], end='')
    print('')
else:
    print('-1')
Problem p02765 (python)

Fixed submission:
n,r=map(int,input().split())
if n>=10:
  print(r)
else:
  print(r+100*(10-n))

Buggy submission (verdict: Runtime Error):
n,r=map(int,input().split())
if n>=10:
  print(r)
else:
  print(r+100*(10-k))

Buggy submission (verdict: Runtime Error):
n,r=map(int,input().split())
if n>=10:
  print(r)
else:
  print(r+100*(10-k))
Problem p03493 (python)

Fixed submission:
# -*- coding: utf-8 -*-
 
a = input()
b = 0
for i in range(3): 
    if a[i] =='1':
        b += 1
print(str(b))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
 
# スペース区切りの整数の入力
a = input()
b = 0
for i in range(3):
	if a[i] =='1':
    	b += 1
print(b)