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

Fixed submission:
a, b = list(map(int, input().split()))
c = list(map(int, input().split()))
itta2 = set([])
mati = 1
i = 0
itta = []
while True:
    if mati in itta2:
        saisyo = mati
        break
    else:
        itta2.add(mati)
        itta.append(mati)
        mati = c[mati-1]
        i += 1
risuto2 = set([])
risuto = []

while True:
    if mati in risuto2:
        break
    else:
        risuto2.add(mati)
        risuto.append(mati)
        mati = c[mati-1]
if b <= i-1:
    print(itta[b])
else:
    print(risuto[(b-i) % len(risuto)])

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
c = list(map(int, input().split()))
itta2 = set([])
mati = 1
i = 0
itta = []
t0 = time.time()
while True:
    if mati in itta2:
        saisyo = mati
        break
    else:
        itta2.add(mati)
        itta.append(mati)
        mati = c[mati-1]
        i += 1
print(time.time()-t0)
risuto2 = set([])
risuto = []
t0 = time.time()

while True:
    if mati in risuto2:
        break
    else:
        risuto2.add(mati)
        risuto.append(mati)
        mati = c[mati-1]
print(time.time()-t0)
if b <= i-1:
    print(itta[b])
else:
    print(risuto[(b-i) % len(risuto)])

Buggy submission (verdict: Runtime Error):
def inp():exec('global inppp\ninpmoto,inppp=input().split(),[]\nfor i in inpmoto:\n try:inppp.append(int(i))if float(i).is_integer()else inppp.append(float(i));\n except:\n  try:inppp.append(str(i))\n  except:print("error in inp")');return inppp[0]if len(inppp)==1else list(inppp)
a, b = inp()
c = inp()
d = []
for i in c:
    d.append(i-1)
itta = []
mati = 0
i = 0
while True:
    if mati in itta:
        saisyo = mati
        break
    else:
        itta.append(mati)
        mati = d[mati]
        i += 1
risuto = []
while True:
    if mati in risuto:
        break
    else:
        risuto.append(mati)
        mati = d[mati]
if b <= i-1:
    print(itta[b]+1)
else:
    print(risuto[(b-i)%3]+1)

Buggy submission (verdict: Runtime Error):
def inp():exec('global inppp\ninpmoto,inppp=input().split(),[]\nfor i in inpmoto:\n try:inppp.append(int(i))if float(i).is_integer()else inppp.append(float(i));\n except:\n  try:inppp.append(str(i))\n  except:print("error in inp")');return inppp[0]if len(inppp)==1else list(inppp)
a, b = inp()
c = inp()
d = []
for i in c:
    d.append(i-1)
itta = []
mati = 0
i = 0
while True:
    if mati in itta:
        saisyo = mati
        break
    else:
        itta.append(mati)
        mati = d[mati]
        i += 1
risuto = []
while True:
    if mati in risuto:
        break
    else:
        risuto.append(mati)
        mati = d[mati]
if b <= i:
    print(itta[b]+1)
else:
    print(risuto[(b-i)%3]+1)
Problem p02732 (python)

Fixed submission:
n = int(input())

a = list(map(int, input().split()))
s = [0]*n
for i in range(n):
    s[a[i]-1] += 1
k = 0
for i in range(n):
    if s[i] >= 2:
        k += ((s[i]*(s[i]-1))//2)
for i in range(n):
    if s[a[i]-1] >= 2:
        print(k-(s[a[i]-1]-1))
    else:
        print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
import sys
sys.setrecursionlimit(100000)
nCr = {}
def cmb(n, r):
    if n >= 2:
        if r == 0 or r == n: return 1
        if r == 1: return n
        if (n, r) in nCr: return nCr[(n, r)]
        nCr[(n, r)] = cmb(n-1, r) + cmb(n-1, r-1)
        return nCr[(n, r)]
    else:
        return 0

A = input().split()
len(set(A))
B = {}
C = {}
for i in set(A):
    B[i] = cmb(A.count(i) - 1, 2)
    C[i] = cmb(A.count(i), 2)
sC = sum(C.values())
for i in A:
    print(B[i] - C[i] + sC)
Problem p02760 (python)

Fixed submission:
import numpy as np


def resolve():
    a_list = list(map(int,input().split()))
    b_list = list(map(int,input().split()))
    c_list = list(map(int,input().split()))
    arr = np.array([a_list, b_list, c_list])

    n = int(input())
    for _ in range(n):
        num = int(input())
        arr = np.where(arr == num, 0, arr)

    if True in np.all(arr == 0, axis=0):
        print('Yes')
        return

    elif True in np.all(arr == 0, axis=1):
        print('Yes')
        return

    elif arr[0, 0] == 0 and arr[1, 1] == 0 and arr[2, 2] == 0:
        print('Yes')
        return

    elif arr[2, 0] == 0 and arr[1, 1] == 0 and arr[0, 2] == 0:
        print('Yes')
        return

    else:
        print('No')
        return
      
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a_list = list(map(int,input().split()))
    b_list = list(map(int,input().split()))
    c_list = list(map(int,input().split()))
    arr = np.array([a_list, b_list, c_list])

    n = int(input())
    for _ in range(n):
        num = int(input())
        arr = np.where(arr == num, 0, arr)

    if True in np.all(arr == 0, axis=0):
        print('Yes')
        return

    elif True in np.all(arr == 0, axis=1):
        print('Yes')
        return

    elif arr[0, 0] == 0 and arr[1, 1] == 0 and arr[2, 2] == 0:
        print('Yes')
        return

    elif arr[2, 0] == 0 and arr[1, 1] == 0 and arr[0, 2] == 0:
        print('Yes')
        return

    else:
        print('No')
        return
      
resolve()
Problem p02801 (python)

Fixed submission:
def resolve():
    a = input()

    print(chr(ord(a) + 1))
    
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n, m = map(int, input().split())

    penalties = 0
    wa_counts = [0] * n
    ac_flags = [0] * n

    for _ in range(m):
        line = input().split()
        q = int(line[0])
        r = line[1]

        if ac_flags[q-1] == 0:
            if r == 'WA':
                wa_counts[q-1] += 1

            else:
                ac_flags[q-1] = 1
                penalties += wa_counts[q-1]

    print(sum(ac_flags), penalties)

resolve()
Problem p02917 (python)

Fixed submission:
n = int(input())
b = list(map(int, input().split()))

b.append(100010)
a = 0
a += b[0]

for i in range(1,n):
  a += (min(b[i], b[i-1]))
           
print(a)

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

b.append(100010)
a = []
a.append(b[0])

for i in range(1,n):
  a.append(min(b[i], b[i-1])
           
print(sum(a))
Problem p02921 (python)

Fixed submission:
s = input()
t = input()

ans = 0
for i in range(3):
  
  a = s[i]
  b = t[i]
  
  if a == b:
    ans += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()

ans = 0
for i in range(3)
  
  a = s[i]
  b = t[i]
  
  if a == b:
    ans += 1
    
print(ans)
Problem p02975 (python)

Fixed submission:
def resolve():
    n = int(input())
    dataset = list(map(int, input().split()))

    xor = 0

    for i in range(n):
        xor ^= dataset[i]

    if xor == 0:
        print('Yes')
    else:
        print('No')
        
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    dataset = set(map(int, input().split()))
    
    xor = 0

    for i in range(n):
        xor ^= dataset[n]
    
    if xor == 0:
        print('Yes')
    else:
        print('No')

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():

    n = int(input())
    dataset = set(map(int, input().split()))

    li_dataset = list(dataset)
    xor = li_dataset[0] ^ li_dataset[1]

    flag = 0
    if xor in dataset:
        flag = 1

    if len(dataset) <= 3 and n % 3 == 0 and flag:
        print('Yes')

    else:
        print('No')
        
resolve()
Problem p03160 (python)

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

dp = [float('inf')] * n

dp[0] = 0

for i in range(1, n):

  dp[i] = min(dp[i], dp[i-1] + abs(li[i] - li[i-1]))
  if i > 1:
    dp[i] = min(dp[i], dp[i-2] + abs(li[i] - li[i-2]))

print(dp[n - 1])

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    heights = list(map(int, input().split()))
    dp = [-1] * n
    dp[0] = 0

    print(jump(n - 1, heights, dp))

# i番目の足場にたどり着いたときの、コストの最小値を返す関数
def jump(i, heights, dp):
    # 足場 0 のコスト
    if i == 0:
        return 0

    if dp[i] != -1:
        return dp[i]

    res = jump(i - 1, heights, dp) + abs(heights[i] - heights[i - 1])
    if i > 1:
        res = min(res, jump(i - 2, heights, dp) + abs(heights[i] - heights[i - 2]))
    dp[i] = res
    return res
  
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    heights = list(map(int, input().split()))
    dp = [-1] * n
    dp[0] = 0

    print(jump(n - 1, heights, dp))

# i番目の足場にたどり着いたときの、コストの最小値を返す関数
def jump(i, heights, dp):
    # 足場 0 のコスト
    if i <= 0:
        return 0

    else:
        if dp[i] != -1:
            return dp[i]
        res = jump(i - 1, heights, dp) + abs(heights[i] - heights[i - 1])
        
        if i > 1:
            res = min(res, jump(i - 2, heights, dp) + abs(heights[i] - heights[i - 2]))
        dp[i] = res
        
        return res

resolve()

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

n = int(input())

data = np.zeros((n, 3), dtype=np.int64)

for i in range(n):

  data[i] = list(map(int, input().split()))

dp = np.zeros((n+1, 3), dtype=np.int64)

for i in range(n):
  for j in range(3):
    for k in range(3):
      if j != k:
        dp[i+1][j] = np.maximum(dp[i][k] + data[i][j], dp[i+1][j])

print(np.max(dp[n]))
Problem p03161 (python)

Fixed submission:
n, k = map(int, input().split())
li = list(map(int, input().split()))

dp = [float('inf')] * n

dp[0] = 0

for i in range(n):
  for j in range(1, k + 1):
    if i + j < n:
      dp[i + j] = min(dp[i + j], dp[i] + abs(li[i] - li[i + j]))

print(dp[n-1])

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

def resolve():
    n = int(input())
    h = np.array(list(map(int, input().split())))
    k = 2

    dp = np.zeros(n, dtype=int)

    for i in range(1, n):
        start = max(0, i - k)
        dp[i] = min(dp[start:i] + np.abs(h[i] - h[start:i]))

    print(dp[n - 1])
    
resolve()
Problem p03162 (python)

Fixed submission:
n = int(input())
li = []

for _ in range(n):
  li.append(list(map(int, input().split())))

dp = [[0] * 3 for _ in range(100010)]

for i in range(n):
  for j in range(3):
    for k in range(3):
      if j != k:
        dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + li[i][k])

print(max(dp[n]))

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

n = int(input())

data = np.zeros((n, 3), dtype=np.int64)

for i in range(n):

  data[i] = list(map(int, input().split()))

dp = np.zeros((n+1, 3), dtype=np.int64)

for i in range(n):
  for j in range(3):
    for k in range(3):
      if j != k:
        dp[i+1][j] = np.maximum(dp[i][k] + data[i][j], dp[i+1][j])

print(np.max(dp[n]))

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

data = np.zeros((n, 3), dtype=np.int64)

for i in range(n):

  data[i] = list(map(int, input().split()))

dp = np.zeros((n+1, 3), dtype=np.int64)

for i in range(n):
  for j in range(3):
    for k in range(3):
      if j != k:
        dp[i+1][j] = np.maximum(dp[i][k] + data[i][j], dp[i+1][j])

print(np.max(dp[n]))
Problem p03288 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(inout())
if n < 1200:
  print('ABC')
elif n < 2800:
  print('ARC')
else:
  print('AGC')

Buggy submission (verdict: Runtime Error):
def resolve():

    d, g = map(int, input().split())

    p = [0] * d
    c = [0] * d

    for i in range(d):
        p[i], c[i] = map(int, input().split())

    ans = 1010

    for i in range(d ** 2):

        sum = 0
        cnt = 0

        for j in range(d):

            if (i >> j) & 1:

                sum += (j + 1) * 100 * p[j]
                sum += c[j]

                cnt += p[j]

        if sum < g:

            for k in range(d)[::-1]:

                flag = 0

                if not (i >> k) & 1:

                    for _ in range(p[k] -1):

                        if sum >= g:
                            flag = 1
                            break

                        sum += (k+1) * 100
                        cnt += 1

                if flag:
                    break

        if sum >= g:
            ans = min(cnt, ans)

    print(ans)
    
resolve()
Problem p03363 (python)

Fixed submission:
from collections import Counter
from math import factorial


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

s = [0]
s_elem = 0

for ai in a:
  
  s_elem += ai
  s.append(s_elem)

ans = 0
for c in Counter(s).values():
  ans += c*(c-1)//2
    
print(ans)

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


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

s = [0]
s_elem = 0

for ai in a:
  
  s_elem += ai
  s.append(s_elem)

ans = 0
for c in Counter(s).values():
  if c > 1:
    ans += i*(i-1)//2
    
print(ans)

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


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

s = [0]
s_elem = 0

for ai in a:
  
  s_elem += ai
  s.append(s_elem)

ans = 0
for c in Counter(s).values():
  if c > 1:
    com = factorial(c) / factorial(2) / factorial(c-2)
    ans += int(com)

print(ans)
Problem p03494 (python)

Fixed submission:
_ = input()
num_list = list(map(int, input().split()))

res = 1000000

for num in num_list:
  count = 0
  
  while(num % 2  == 0):
    num /= 2
    count += 1
  
  if count < res:
    res = count
    
print(res)

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

res = 0

for num in range(num_list):
  count = 0
  
  while(num % 2  == 0):
    num /= 2
    count += 1
  
  if count > res:
    res = count
    
print(res)
Problem p03636 (python)

Fixed submission:
s = input()
print(s[0] + str(len(s[:-2])) + s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
print(s[0] + len(s[:-2]) + s[-1])
Problem p03161 (python)

Fixed submission:
import numpy as np

N, K = map(int, input().split())
h = np.array(list(map(int, input().split())), dtype='int')
dp = np.ones(N, dtype='int') * 1000000000
dp[0] = 0

for i in range(1, N):
    dp[i] = min(dp[max(i-K,0):i] + abs(h[max(i-K,0):i] - h[i]))

print(dp[N - 1])

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

dp = [1000000000] * N
dp[0] = 0

for i in range(1, N):
    dp[i] = min(dp[i], abs(min(h[max(i-K,0):i]
                              ) - h[i] + dp[i]))

print(dp[N - 1])

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

dp = [1000000000] * N
dp[0] = 0

for i in range(N - 1):
    for j in range(1, min(K + 1, N-1)):
        dp[i + j] = min(abs(h[i + j] - h[i]) + dp[i])

print(dp[N - 1])
Problem p03244 (python)

Fixed submission:
import collections

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

list_e = [list[i] for i in range(0,n-1,2)]
list_o = [list[i] for i in range(1,n,2)]
e = collections.Counter(list_e)
o = collections.Counter(list_o)
mode_e=e.most_common(2)
mode_o=o.most_common(2)
mode_e.append((-1,0))
mode_o.append((-1,0))
if mode_e[0][0]==mode_o[0][0]:
    print(n-max(mode_e[0][1]+mode_o[1][1],mode_e[1][1]+mode_o[0][1]))
    # if mode_e[0][1]>mode_o[0][1]:
    #     mode_e_value=mode_e[0][1]
    #     mode_o_value=mode_o[1][1]
    # else:
    #     mode_e_value=mode_e[1][1]
    #     mode_o_value=mode_o[0][1]
else:
    mode_e_value = mode_e[0][1]
    mode_o_value = mode_o[0][1]
    print(n-mode_e_value-mode_o_value)

Buggy submission (verdict: Runtime Error):
import collections

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

list_e = [list[i] for i in range(0,n-1,2)]
list_o = [list[i] for i in range(1,n,2)]
e = collections.Counter(list_e)
o = collections.Counter(list_o)
mode_e=e.most_common(2)
mode_o=o.most_common(2)
if mode_e[0][0]==mode_o[0][0]:
    if mode_e[0][1]>mode_o[0][1]:
        mode_e_value=mode_e[0][1]
        mode_o_value=mode_o[1][1]
    else:
        mode_e_value=mode_e[1][1]
        mode_o_value=mode_o[0][1]
else:
    mode_e_value = mode_e[0][1]
    mode_o_value = mode_o[0][1]
print(n-mode_e_value-mode_o_value)
Problem p03030 (python)

Fixed submission:
n = int(input())

scores = []
for i in range(1, n+1):
    c, s = input().split()
    scores.append(("{0}{1}{2:03d}".format(c, "0" * (10 - len(c)), 101 - int(s)), i))

for c, ind in sorted(scores):
    print(ind)

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

data = dict()

for i in range(1, n + 1):
  city, score = input().split()
  data[city] = [int(score), i]

for key in sorted(data.keys()):
  for _, num in sorted(data[key], key=lambda x: -x[0]):
    print(num)
Problem p03037 (python)

Fixed submission:
from itertools import accumulate

n, m = map(int, input().split())
cards = [0] * (n+2)
for i in range(m):
  s, e = map(int, input().split())
  cards[s] += 1
  cards[e+1] -= 1
valids = list(accumulate(cards))
print(valids.count(m))

Buggy submission (verdict: Runtime Error):
from itertools import accumulate

n, m = map(int, input().split())
cards = [0] * (n+1)
for i in range(m):
  s, e = map(int, input().split())
  cards[s] += 1
  cards[e] -= 1
valids = accumulate(cards)
print(valids.count(n))
Problem p03370 (python)

Fixed submission:
n, m = map(int, input().split())
mi = 1e10
for i in range(n):
  s = int(input())
  mi = min(mi, s)
  m -= s
print(n + m // mi)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
mi = 1e10
for i in range(n):
  s = int(input())
  mi = min(min, s)
  m -= s
print(n + m // mi)
Problem p03382 (python)

Fixed submission:
import bisect
n = int(input())
a = sorted(list(map(int, input().split())))
l, r = 0, 0
l = max(a)
a.remove(l)
j = bisect.bisect_left(a, l/2)
try:
    if abs((l/2) - a[j-1]) < abs((l/2) - a[j]):
        j -= 1
except:
    pass
print(l, a[min(j, len(a)-1)])

Buggy submission (verdict: Runtime Error):
import bisect
n = int(input())
a = sorted(list(map(int, input().split())))
l, r = 0, 0
l = max(a)
a.remove(l)
j = bisect.bisect_left(a, l/2)
if abs((l/2) - a[j-1]) < abs((l/2) - a[j]):
    j -= 1
print(l, a[min(j, len(a)-1)])

Buggy submission (verdict: Runtime Error):
import bisect
n = int(input())
a = sorted(list(map(int, input().split())))
l, r = 0, 0
l = max(a)
a.remove(l)
j = bisect.bisect_left(a, l/2)
if abs((l/2) - a[j]) > abs((l/2) - a[j+1]):
    j += 1
print(l, a[min(j, len(a)-1)])
Problem p03448 (python)

Fixed submission:
ans = 0
fhun = int(input())
hun = int(input())
fif = int(input())
money = int(input())
for i in range(fhun + 1):
  for j in range(hun + 1):
    for l in range(fif + 1):
      if (500 * i + 100 * j + 50 * l) == money:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
ans = 0
5hun = int(input())
hun = int(input())
fif = int(input())
money = int(input())
for i in range(5hun + 1):
  for j in range(hun + 1):
    for l in range(fif + 1):
      if (500 * i + 100 * j + 50 * l) == money:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
ans = 0
for i in range(int(input())):
  for j in range(int(input())):
    for l in range(int(input())):
      try:
        money = int(input())
      except:
        pass
      if (500 * i + 100 * j + 50 * l) == money:
        ans += 1
print(ans)
Problem p03457 (python)

Fixed submission:
n = int(input())
pretime, prex, prey = 0, 0, 0
for i in range(n):
    nowtime, nowx, nowy = map(int, input().split())
    time = nowtime - pretime
    x = abs(nowx - prex)
    y = abs(nowy - prey)
    if x+y > time:
        print("No")
        exit()
    if (x+y) % 2 != time % 2:
        print("No")
        exit()
    pretime = nowtime
    prex, prey = nowx, nowy
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if (x+y) > t and (x+y)%2 != t%2):
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y) <= t and (x + y) % 2 != t % 2:
        print("No")
        exit()
print("Yes")
Problem p03473 (python)

Fixed submission:
print(48 - int(input()))

Buggy submission (verdict: Runtime Error):
n = int(input())
cc = []
ss = []
ff = []
for i in range(n-1):
    c, s, f = list(map(int, input().split()))
    cc.append(c)
    ss.append(s)
    ff.append(f)
for l in range(n-1):
    ans = ss[l]+cc[l]
    for k in range(l+1, n-1):
        temp = ss[k]
        while temp < ans:
            temp += ff[k]
        ans = temp + cc[k]
    print(ans)
print(0)
Problem p03481 (python)

Fixed submission:
x, y = list(map(int, input().split()))
a = x
ans = 0
while a <= y:
    a = a << 1
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
  from math import frexp
  a, b = map(int, input().split())
  print(frexp(b)[1]-frexp(a)[1]+1)

Buggy submission (verdict: Runtime Error):
from math import frexp
a, b = map(int, input().split())
print(frexp(b)-frexp(a)+1)
Problem p03544 (python)

Fixed submission:
import functools


@functools.lru_cache()
def f(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    else:
        return f(n - 1) + f(n - 2)


print(f(int(input())))

Buggy submission (verdict: Runtime Error):
import functools
 
 
@functools.lru_cache()
def f(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    else:
        return f(n-1)+f(n-2)
 
print(f(int(input())
Problem p03573 (python)

Fixed submission:
a = list(map(int, input().split()))
if a[0] == a[1]:
    print(a[2])
elif a[0] == a[2]:
    print(a[1])
elif a[1] == a[2]:
    print(a[0])

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if a[0] == a[1]:
    print(a[3])
elif a[0] == a[2]:
    print(a[1])
elif a[1] == a[2]:
    print(a[0])

Buggy submission (verdict: Runtime Error):
a = input().split()
if a[0] == a[1]:
    print(a[3])
elif a[0] == a[2]:
    print(a[1])
elif a[1] == a[2]:
    print(a[0])

Buggy submission (verdict: Runtime Error):
a = input().split()
if a[0] == a[1]:
    print(int(a[3]))
elif a[0] == a[2]:
    print(int(a[1]))
elif a[1] == a[2]:
    print(int(a[0]))

Buggy submission (verdict: Runtime Error):
a = input().split()
if a[0] == a[1]:
    print(int(a[3]))
if a[0] == a[2]:
    print(int(a[1]))
if a[1] == a[2]:
    print(int(a[0]))
Problem p03591 (python)

Fixed submission:
inn = input()
ans = "No"
try:
    if inn[0] == "Y" and inn[1] == "A" and inn[2] == "K" and inn[3] == "I":
        ans = "Yes"
except:
    pass
print(ans)

Buggy submission (verdict: Runtime Error):
inn = input()
ans = "No"
if inn[0] == "Y" and inn[1] == "A" and inn[2] == "K" and inn[3] == "I":
    ans = "Yes"
print(ans)
Problem p03607 (python)

Fixed submission:
time = int(input())
ans = []
n = 0
for i in range(time):
    ans.append(input())
ans.sort(key=int)
while n+1 < len(ans):
    if ans[n] == ans[int(n + 1)]:
        ans.pop(n)
        ans.pop(n)
    else:
        n += 1
print(len(ans))

Buggy submission (verdict: Runtime Error):
print(len(set(list(lambda x: not x%2, set([input() for i in range(int(input()))])))))

Buggy submission (verdict: Runtime Error):
ans = []
i = 0
for i in range(int(input()):
    now = input()
    if now in ans:
        ans.remove(now)
    else:
        ans.append(now)
print(len(ans))
Problem p03623 (python)

Fixed submission:
a = input().split()
if (max(int(a[0]), int(a[1])) - min(int(a[0]), int(a[1]))) > (max(int(a[0]), int(a[2])) - min(int(a[0]), int(a[2]))):
    print("B")
elif (max(int(a[0]), int(a[1])) - min(int(a[0]), int(a[1]))) < (max(int(a[0]), int(a[2])) - min(int(a[0]), int(a[2]))):
    print("A")

Buggy submission (verdict: Runtime Error):
cou = int(input())
bars = input().split()
two = [0, 0]
i = 0
ca = len(bars)
while i < ca:
    if bars[i] in two:
        pass
    else:
        now = bars[i]
        if bars.count(now) > 3:
            two.extend(now)
            two.extend(now)
        elif bars.count(now) > 1:
            two.extend(now)
        else:
            pass
    i += 1
two.sort(key=int)
ans = int(two[-1]) * int(two[-2])
print(ans)