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

Fixed submission:
from math import factorial
import collections

N = int(input())
BALLS = list(map(int, input().split()))

MEMO = {}
def fact(n):
    if MEMO.get(n):
        return MEMO[n]
    r = 2
    if n - r < 0:
        MEMO[n] = 0
        return 0
    MEMO[n] = factorial(n) // factorial(r) // factorial(n - r)
    return MEMO[n]

COUNTS = collections.Counter(BALLS)
TOTAL = sum(fact(n) for n in COUNTS.values())

MEMO2 = {}
def solve(n):
    if MEMO2.get(n):
        return MEMO2[n]

    MEMO2[n] = TOTAL - fact(COUNTS[n]) + fact(COUNTS[n] - 1)
    return MEMO2[n]

for i in range(N):
    print(solve(BALLS[i]))

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
from math import factorial
import collections

N = int(input())
BALLS = list(map(int, input().split()))

COUNTS = collections.Counter(BALLS)


MEMO = {}
def fact(n):
    if MEMO.get(n):
        return MEMO[n]
    r = 2
    if n - r < 0:
        return 0
    MEMO[n] = int(comb(n, r))
    return MEMO[n]

MEMO2 = {}
def solve(n):
    if MEMO2.get(n):
        return MEMO2[n]

    MEMO2[n] = sum(fact(v if k != n else v - 1) for (k, v) in COUNTS.items())
    return MEMO2[n]

for i in range(N):
    print(solve(BALLS[i]))
Problem p02784 (python)

Fixed submission:
import sys

sys.setrecursionlimit(200000)

def dfs(i, total):
    if (i > A - 1):
        return False
    if (total - SPECIALS[i] <= 0):
        return True
    else:
        return dfs(i + 1, total - SPECIALS[i])

H, A = map(int, input().split())
SPECIALS = map(int, input().split())
SPECIALS = list(reversed(sorted(SPECIALS)))

print("Yes" if dfs(0, H) else "No")

Buggy submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(20000)

def dfs(i, total):
    if (i > A - 1):
        return False
    if (total - SPECIALS[i] <= 0):
        return True
    else:
        return dfs(i + 1, total - SPECIALS[i])

H, A = map(int, input().split())
SPECIALS = map(int, input().split())
SPECIALS = list(reversed(sorted(SPECIALS)))

print("Yes" if dfs(0, H) else "No")

Buggy submission (verdict: Runtime Error):
def dfs(i, total):
    if (i > A - 1):
        return False
    if (total - SPECIALS[i] <= 0):
        return True
    else:
        return dfs(i + 1, total - SPECIALS[i])

H, A = map(int, input().split())
SPECIALS = map(int, input().split())
SPECIALS = list(reversed(sorted(SPECIALS)))

print("Yes" if dfs(0, H) else "No")
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
a, b, k = int(i) for i in input().split()
takahashi = a - k
aoki = b + takahashi if takahashi < 0 else b
print(f"{max(takahashi, 0)} {max(aoki, 0)}")
Problem p02818 (python)

Fixed submission:
a, b, k = (int(i) for i in input().split())
takahashi = a - k
aoki = b + takahashi if takahashi < 0 else b
print("{} {}".format(max(takahashi, 0), max(aoki, 0)))

Buggy submission (verdict: Runtime Error):
a, b, k = (int(i) for i in input().split())
takahashi = a - k
aoki = b + takahashi if takahashi < 0 else b
print(f"{max(takahashi, 0)} {max(aoki, 0)}")

Buggy submission (verdict: Runtime Error):
a, b, k = int(i) for i in input().split()
takahashi = a - k
aoki = b + takahashi if takahashi < 0 else b
print(f"{max(takahashi, 0)} {max(aoki, 0)}")

Buggy submission (verdict: Runtime Error):
a, b, k = input().split()
takahashi = a - k
aoki = b + takahashi if takahashi < 0 else b
print(f"{max(takahashi, 0)} {max(aoki, 0)}")
Problem p03288 (python)

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

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

Fixed submission:
import sys
import fractions
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num // fractions.gcd(res, num)

print(int(res))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    elif num1 == 0:
        return 1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num / gcd(res, num)

print(int(res))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(200000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res * num / gcd(res, num)

print(int(res))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(2000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = NUMS[0]
for num in NUMS[1:]:
    res = res  * num / gcd(res, num)

print(int(res))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(2000000)

N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = []
for num1 in NUMS:
    for num2 in NUMS:
        if num1 == num2:
            continue
        res.append(int(num1  * num2 / gcd(num1, num2)))

print(max(res))

Buggy submission (verdict: Runtime Error):
N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))

def gcd(num1, num2):
    if num2 == 0:
        return num1
    else:
        return gcd(num2, num1 % num2)


res = []
for num1 in NUMS:
    for num2 in NUMS:
        if num1 == num2:
            continue
        res.append(int(num1  * num2 / gcd(num1, num2)))

print(max(res))
Problem p03160 (python)

Fixed submission:
n = int(input())
h = [i for i in map(int, input().split())]

DP = [0, abs(h[0]-h[1])]

for i in range(n-2):
   DP += [min(DP[-2] + abs(h[i]-h[i+2]), DP[-1] + abs(h[i+1]-h[i+2]))]

print(DP[-1])

Buggy submission (verdict: Runtime Error):
n = input()
h = [i for i in map(int, input())]

DP = [0, abs(h[0]-h[1])]

for i in range(n-2):
    DP += [min(abs(h[i+2]-h[i])+DP[i], abs(h[i+2]-h[i+1])+DP[i+1])]

print(DP[-1])
Problem p02817 (python)

Fixed submission:
s, t = input().split(' ')

print(t+s)

Buggy submission (verdict: Runtime Error):
s, t = list(map(int, input().split(' ')))

print(t+s)
Problem p03281 (python)

Fixed submission:
n = int(input())

result = 0
for i in range(1, n+1, 2):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        result += 1

print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())

result = 0
for i in range(1, n, 2):
    count = 0
    for j in range(i//2):
        if i % j == 0:
            count += 1
    if count == 8:
        result += 1

print(result)
Problem p02713 (python)

Fixed submission:
k=int(input())
import math
if k==1:
    print(1)
else:
    s1=k*(k+1)//2
    s2=k-1
    for i in range(2,k):
        for j in range(i+1,k+1):
                s2+=math.gcd(i,j)
    s2=s2*6
    s3=0
    if k>2:
        for a in range(1,k-1):
            for b in range(a+1,k):
                for c in range(b+1,k+1):
                    s3+=math.gcd(math.gcd(a,b),c)
        s3=s3*6
    print(s1+s2+s3)

Buggy submission (verdict: Runtime Error):
k=int(input())
import math
if k==1:
    print(1)
else:
    s1=k*(k+1)//2
    s2=k-1
    for i in range(2,k):
        for j in range(i+1,k+1):
                s2+=math.gcd(i,j)
    s2=s2*6
    s3=0
    if k>2:
        for a in range(1,k-1):
            for b in range(a+1,k):
                for c in range(b+1,k+1):
                    s3+=math.gcd(math.gcd(a,b),c)
        s3=s3*6
print(s1+s2+s3)
Problem p02898 (python)

Fixed submission:
N, K = input().split()
l = list(int(i) for i in input().split())
count = 0
 
for i in l:
  if(i >= int(K)):
    count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
N, K = input().split()
l = list(int(i) for i int input().split())
count = 0
 
for i in l:
  if(i > K):
    count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
N, K = input().split()
l = list(int(i) for i int input().split())
count = 0

for i in l:
  if(i > K):
    count = count + 1

print(count)
Problem p02796 (python)

Fixed submission:
import sys
N = int(input())
a = sorted([(x + l, x - l) for x, l in (map(int, l.split()) for l in sys.stdin)])

last = a[0][0]
ans = 1

for r, l in a[1:]:
    if last <= l:
        ans += 1
        last = r

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted([(x + l, x - l) for x, l in (map(int, l.split()) for l in sys.stdin)])

last = a[0][0]
ans = 1

for r, l in a[1:]:
    if last <= l:
        ans += 1
        last = r

print(ans)
Problem p02807 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
import numpy as np
 
MOD = 10 ** 9 + 7
 
N = int(readline())
X = np.array(read().split(),np.int64)
 
def cumprod(A, MOD = MOD):
    L = len(A); Lsq = int(L**.5+1)
    A = np.resize(A, Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        A[:,n] *= A[:,n-1]; A[:,n] %= MOD
    for n in range(1,Lsq):
        A[n] *= A[n-1,-1]; A[n] %= MOD
    return A.ravel()[:L]
def make_fact(U, MOD = MOD):
    x = np.arange(U, dtype = np.int64); x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64); x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact,fact_inv
 
U = 10 ** 5 + 5
fact, fact_inv = make_fact(U)
 
inv = np.zeros(U,np.int64)
inv[1:] = fact_inv[1:] * fact[:-1] % MOD
 
coef = inv[1:N].cumsum() % MOD
 
answer = (np.diff(X) * coef % MOD).sum() % MOD
answer *= fact[N-1]; answer %= MOD
 
print(answer)

Buggy submission (verdict: Runtime Error):
n,*c=map(int,open(0).read().split())
mod=10**9+7
dif=[j-i for i,j in zip(c,c[1:])]
fac=[1]*n
#階乗。毎回modで割っても大丈夫
for i in range(1,n):
    fac[i]=fac[i-1]*i%mod

inv=[pow(i,mod-2,mod) for i in range(n)]
#itertoolより。
acc_inv=list(accumulate(inv))
ans=0
for k in range(1,n):
    ans+=dif[k-1]*acc_inv[k]
    ans%=mod
print(ans*fac[-1]%mod)

Buggy submission (verdict: Runtime Error):
from statistics import mean
from math import factorial
import numpy as np
N = int(input())
H = list(map(int, input().split()))
MOD = 1000000007
diff=[]
for i in range(N-1):
    diff.append(H[i+1]-H[i])

diff=np.array(diff)
multi=np.array([mean(list(range(1,i+1)))*factorial(N-1) for i in range(1,N)])
# print(multi)
# print(diff)
print(int(np.sum(diff*multi)%MOD))
Problem p02837 (python)

Fixed submission:
N = int(input())
E = []
for n in range(N):
    A = int(input())
    for _ in range(A):
        x, y = list(map(int, input().split()))
        E.append((n, x - 1, y))
ans = 0
for k in range((1 << N) - 1, -1, -1):
    status = [(k >> i) & 1 for i in range(N)]
    no_paradox = True
    for Xa, Xb, yb in E:
        if (status[Xa] == 1 and status[Xb] != yb):
            no_paradox = False
            break
    if no_paradox:
        ans = max(ans, sum(status))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
E = []
for n in range(N):
    A = int(input())
    for _ in range(A):
        x, y = list(map(int, input().split()))
        E.append((n, x - 1, y))
ans = 0
for k in range((1 << N)):
    status = [(k >> i) & 1 for i in range(N)]
    no_paradox = True
    for Xa, Xb, yb in E:
        if (status[Xa] == 1 and status[Xb] == yb):
            no_paradox = False
            break
    if no_paradox:
        ans = max(ans, sum(l))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
E = []
for n in range(N):
    A = int(input())
    for _ in range(A):
        x, y = list(map(int, input().split()))
        E.append((n, x - 1, y))
ans = 0
for k in range((1 << N)):
    status = [(k >> i) & 1 for i in range(N)]
    no_paradox = True
    for Xa, Xb, yb in E:
        if (status[Xa] == 1 and status[Xb] == yb):
            no_paradox = False
            break
    if no_paradox:
        ans = max(ans, sum(l))

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

E = []
for n in range(N):
  A = int(input())
  for _ in range(A):
    x, y = list(map(int, input().split()))
    E.append((n, x - 1, y))

    for k in range((1 << N)):
      status = [(k >> i) & 1 for i in range(N)]
      no_paradox = True
      for Xa, Xb, yb in E:
        if (status[Xa] == 1 and status[Xb] == yb):
          no_paradox = False
          break
          if no_paradox:
            ans = max(ans, sum(l))
print(ans)
Problem p02917 (python)

Fixed submission:
#c
import numpy as np
N = int(input())
B = list(map(int, input().split()))
A = [0]*N
if N>2:
    A[0]=B[0]
    for i in range(1,N-1):
        A[i]=min(B[i],B[i-1])
    A[N-1]=B[N-2]
    print(np.sum(A))
else:
    print(B[0]*2)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
B = list(map(int, input().split()))
A = [0]*N
A[0]=min(B[0],B[1])
for i in range(1,N-1):
    A[i]=min(B[i],B[i-1])
A[N-1]=B[N-2]
print(np.sum(A))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
B = list(map(int, input().split()))
A = [0]*N
A[0]=min(B[0],B[1])
print(len(A),len(B))
for i in range(1,N-1):
    A[i]=min(B[i],B[i-1])
A[N-1]=B[N-2]
print(np.sum(A))
Problem p02947 (python)

Fixed submission:
from collections import Counter,defaultdict
N =int(input())
S = []
#キーが存在しなかったときのデフォルトの値を定義できる
dict=defaultdict(int)
ans=0
for _ in range(N):
    s=''.join(sorted(input()))
    ans+=dict[s]
    dict[s]+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N =int(input())
#S = list(map(str, input().split()))
# S = list(map(str, input().split()))
S = []
for _ in range(H):
    S.append(input())

#受け取った文字列をアルファベットに並び替え
S=[''.join(sorted(a)) for a in S]

#バケットを作って、出現回数をカウント
count=[0]*(len(set(S)))
unique_S=list(set(S))
ans=0
for ele in S:
    count[unique_S.index(ele)]+=1
count=sorted(count,reverse=True)

#階乗のコード
def cor(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact
#組み合わせのコード
def combination(n,c):
    a=(cor(n))/(cor(n-c)*cor(c))
    return a

for i in count:
    if i==1:
        break
    else:
        ans+=combination(i,2)
print(int(ans))
Problem p03031 (python)

Fixed submission:
n, m = map(int, input().split())
s = []
for i in range(m):
    st = list(map(int, input().split()))
    s.append(st[1 :])
p = list(map(int, input().split()))

ans = 0
#あるつき方について
for i in range(1 << n):
    al = True
    #つき方二進数
    v = [bool(i & (1 << x)) for x in range(n)]
    #電球全体
    for j in range(m):
        #onになってるスイッチの個数
        num = 0
        #スイッチの番号
        for t in s[j]:
            num += v[t - 1]
        if p[j] != num % 2:
            al = False
    ans += al
print(ans)

Buggy submission (verdict: Runtime Error):
s = []
for i in range(m):
  st = list(map(int, input().split()))
  s.append(st[1 :])
  p = list(map(int, input().split()))

  ans = 0
  #あるつき方について
  for i in range(1 << n):
    al = True
    #つき方二進数
    v = [bool(i & (1 << x)) for x in range(n)]
    #電球全体
    for j in range(m):
      #onになってるスイッチの個数
      num = 0
      #スイッチの番号
      for t in s[j]:
        num += v[t - 1]
        if p[j] != num % 2:
          al = False
          ans += al
          print(ans)
Problem p02720 (python)

Fixed submission:
def lunlun_maker(l: int) -> int:
    next_lunluns = []
    for e in l:
        nxt = e * 10
        mod = e % 10
        if 0 < mod < 9:
            next_lunluns.extend([nxt + mod - 1, nxt + mod, nxt + mod + 1])
        elif mod == 0:
            next_lunluns.extend([nxt, nxt + 1])
        elif mod == 9:
            next_lunluns.extend([nxt + 8, nxt + 9])
    return next_lunluns


def get_lunlun(num: int) -> int:
    lunluns = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    counter = len(lunluns)
    counter_tmp = counter
    while counter < num:
        lunluns = lunlun_maker(lunluns)
        counter_tmp = counter
        counter += len(lunluns)
    return lunluns[num - counter_tmp - 1]


K = int(input())
print(get_lunlun(K))

Buggy submission (verdict: Runtime Error):
from typing import List


def lunlun_maker(l: List[int]) -> List[int]:
    next_lunluns = []
    for e in l:
        nxt = e * 10
        mod = e % 10
        if 0 < mod < 9:
            next_lunluns.extend([nxt + mod - 1, nxt + mod, nxt + mod + 1])
        elif mod == 0:
            next_lunluns.extend([nxt, nxt + 1])
        elif mod == 9:
            next_lunluns.extend([nxt + 8, nxt + 9])
    return next_lunluns


def get_lunlun(num: int) -> int:
    lunluns = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    counter = len(lunluns)
    counter_tmp = counter
    while counter < num:
        lunluns = lunlun_maker(lunluns)
        counter_tmp = counter
        counter += len(lunluns)
    return lunluns[num - counter_tmp - 1]


K = int(input())
print(get_lunlun(K))
Problem p03254 (python)

Fixed submission:
import numpy

N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
a_sum = numpy.cumsum(a)
ans = numpy.sum(a_sum <= x)

if ans == N and x not in a_sum:
    ans -= 1

print(ans)

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

for i in range(len(a)):
    x -= a[i]
    if x >= 0:
        ans = i + 1

print(ans)
Problem p03302 (python)

Fixed submission:
[a, b] = map(int, input().split())
if a+b == 15:
  print("+")
elif a*b == 15:
  print("*")
else:
    print("x")

Buggy submission (verdict: Runtime Error):
[a, b] = input().split()
if a+b == 15:
  print("+")
elif a*b == 15:
  print("*")
else:
    print("x")

Buggy submission (verdict: Runtime Error):
[a, b] = input().split()
if a+b == 15:
  print("+")
  return
if a*b == 15:
  print("*")
  return
print("x")
return
Problem p03303 (python)

Fixed submission:
import sys

S = input()
w = int(input())

for index, s in enumerate(S):
    if index % w == 0:
        sys.stdout.write(s)

Buggy submission (verdict: Runtime Error):
S = input()
w = int(input())

for index, s in enumerate(S):
    if index % w == 0:
        sys.stdout.write(s)
Problem p03341 (python)

Fixed submission:
N = input()
S = list(input())

length = len(S)
min_num = 300000
left = 0
right = S.count("E")

for i in range(length):

  if i > 0:
    left += int(S[i - 1] == "W")

  if i < length:
    right -= int(S[i] == "E")

  if left + right < min_num:
    min_num = left + right

print(min_num)

Buggy submission (verdict: Runtime Error):
N = input()
S = list(input())

length = len(S)
min_num = 300000
left = 0
right = S.count("E")

for i in range(length):

  if i > 0:
    left += int(S[i - 1] == "W")

  if i < length:
    right -= int(S[i + 1] == "E")

  if left + right < min_num:
    min_num = left + right

print(min_num)

Buggy submission (verdict: Runtime Error):
N = input()
S = list(input())

min_num = 300000
left = 0
right = S.count("E")

for i in range(len(S)):

  if i > 0:
    left += int(S[i - 1] == "W")

  right -= int(S[i + 1] == "E")

  if left + right < min_num:
    min_num = left + right

print(min_num)

Buggy submission (verdict: Runtime Error):
N = input()
S = split(input())

turns_num_list = list()
for i, s in enumerate(S):
  left = [S == "E" for j in S[0:j]].count()
  right = [S[j] == "W" for j in S[j+1:]].count()
  turns_num_list.append(left+right)

print(min(turns_num_list))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

A_list = list()
for i in range(A+1) :
    A_list.append(i*500)
B_list = list()
for i in range(B+1) :
    B_list.append(i*100)
C_list = list()
for i in range(C+1) :
    C_list.append(i*50)

count = 0
for a in A_list :
    for b in B_list :
        for c in C_list :
            if (a + b + c) == X :
                count += 1

print(count)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

A_list = list()
for i in range(A) :
    A_list.append(i*500)
B_list = list()
for i in range(B) :
    B_list.append(i*100)
C_list = list()
for i in range(C) :
    C_list.append(i*50)

count = 0
for a in A_list :
    for b in B_list :
        for c in C_list :
            if (a + b + c) == X :
                count += 1

print count
Problem p03555 (python)

Fixed submission:
input1 = input()
input2 = input()

if input1[::-1] == input2[::] :
    print("YES")
else :
    print("NO")

Buggy submission (verdict: Runtime Error):
input1 = input().split(' ')
input2 = input().split(' ')

if input1[2] == input2[0] :
    if input1[1] == input2[1] :
        if input1[0] == input2[2] :
            print("YES")
        else :
            print("NO")
    else :
        print("NO")
else :
    print("NO")

Buggy submission (verdict: Runtime Error):
input1 = input().split(' ')
input2 = input().split(' ')

if input1[2] == input2[0] :
    if input1[1] == input2[1] :
        if input1[0] == input2[2] :
            print("Yes")
        else :
            print("No")
    else :
        print("No")
else :
    print("No")
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
print(2*G - R)

Buggy submission (verdict: Runtime Error):
R = input()
G = input()
print 2*G - R
Problem p02760 (python)

Fixed submission:
card = []
for i in range(3):
    card.append(list(map(int, input().split())))

N = int(input())

result = [[0, 0, 0],[0, 0, 0],[0, 0, 0]]
for _ in range(N):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if b == card[i][j]:
                result[i][j] = 1

judge = 'No'

for i in range(3):
    if result[i][0] * result[i][1] * result[i][2] == 1:
        judge = 'Yes'

for i in range(3):
    if result[0][i] * result[1][i] * result[2][i] == 1:
        judge = 'Yes'

if result[0][0] * result[1][1] * result[2][2] == 1:
    judge = 'Yes'

if result[0][2] * result[1][1] * result[2][0] == 1:
    judge = 'Yes'

print(judge)

Buggy submission (verdict: Runtime Error):
bingo_l = []
        
for _ in range(3):
    bingo_l.append(list(map(int, input().split())))

N = int(input())

kekka_l = [[0, 0, 0],[0, 0, 0],[0, 0, 0]]

for _ in range(N):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if b == bingo_l[i][j]:
                kekka_l[i][j] = 1
                break

for i in range(3):
    if sum(kekka_l[i]) == 3:
        b_flg = 1
        break

sum = 0

for j in range(3):
    for i in range(3):
        sum += kekka_l[i][j]
        if sum == 3:
            b_flg = 1
            break

if kekka_l[0][0] + kekka_l[1][1] + kekka_l[2][2] == 3:
    b_flg = 1

if kekka_l[0][2] + kekka_l[1][1] + kekka_l[2][0] == 3:
    b_flg = 1

if b_flg == 1:
    print('yes')
else:
    print('No')