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

Fixed submission:
def splitter(type,input):
    return list(map(lambda x:type(x),input.split()))

s1 = splitter(int,input())
N = s1[0]
K = s1[1]
Q = s1[2]

ar = [0] * N
for i in range(Q):
    ar[int(input())-1] += 1
for j in range(N):
    if K-Q+ar[j] <= 0:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
def splitter(type,input):
    return list(map(lambda x:type(x),input.split()))

s1 = splitter(int,input())
N = s1[0]
K = s1[1]
Q = s1[2]

ar = [0] * N
for i in range(Q):
    ar[int(input())] += 1
for j in range(N):
    if K-Q+ar[j] <= 0:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
def splitter(type,input):
    return list(map(lambda x:type(x),input.split()))

s1 = splitter(int,input())
N = s1[0]
K = s1[1]
Q = s1[2]

ar = [0] * N
for i in len(range(Q)):
    ar[int(input())] += 1
for j in len(range(N)):
    if K-Q+ar[j] <= 0:
        print("No")
    else:
        print("Yes")
Problem p02731 (python)

Fixed submission:
l = float(input())

x = l/3

print(x**3)

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

vol = []

for x in range(1, l):
    for y in range(1, l-x):
        z = l - x -y
        t = x*y*z
        vol.append(t)

print(max(vol))
Problem p02765 (python)

Fixed submission:
inputStr = input()
inputList = inputStr.split(' ')
n = int(inputList[0])
r = int(inputList[1])

if n >= 10:
    print(int(r))
else:
    a = 100*(10-n)
    print(int(r+a))

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

if n >= 10:
    print(int(r))
else:
    a = 100*(10-n)
    print(int(r+a))
Problem p02981 (python)

Fixed submission:
s = input()
l = s.split(" ")

n = int(l[0])
a = int(l[1])
b = int(l[2])
#print(l)
train = n * a
taxi = b

if(taxi < train):
    print(taxi)
else:
    print(train)

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

n = int(s[0])
a = int(s[2])
b = int(s[4])

train = n * a
taxi = b

if(taxi < train):
    print(taxi)
else:
    print(train)
Problem p02719 (python)

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

amari = N%K
bmari = abs(amari-K)
if amari >= bmari:
    print(bmari)
else:
    print(amari)

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

# N = 1000000000000000000
# K = 1
amari = N%K
bmari = abs(amari-K)
if amari >= bmari:
    print(bmari)
else:
    print(amari)
Problem p02850 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def main():
    n = int(input())
    color = [None]*(n-1)
    color[0] = -1

    con = [[] for _ in range(n)]
    for i in range(n-1):
        a, b = map(int, input().split())
        con[a-1].append((b-1, i))
        con[b-1].append((a-1, i))

    def dfs(now=0, prev=-1, mycolor=-1):
        in_use = {mycolor}
        i = 0

        for tup in con[now]:
            if tup[0] != prev:
                while True:
                    if i not in in_use:
                        color[tup[1]] = i
                        in_use.add(i)
                        break
                    i += 1
                dfs(tup[0], now, i)

    dfs()

    print(max(color)+1)
    for i in color:
        print(i+1)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def main():
    n = int(input())
    color = [None]*(n-1)
    color[0] = -1

    con = [[] for _ in range(n)]
    for i in range(n-1):
        a, b = map(int, input().split())
        con[a-1].append((b-1, i))
        con[b-1].append((a-1, i))

    def dfs(now=0, prev=-1, mycolor=-1):
        in_use = {mycolor}
        i = 0

        for tup in con[now]:
            if tup[0] != prev:
                while i < 1000:
                    if i not in in_use:
                        color[tup[1]] = i
                        in_use.add(i)
                        break
                    i += 1
                dfs(tup[0], now, i)

    dfs()

    print(max(color)+1)
    for i in color:
        print(i+1)


if __name__ == '__main__':
    main()
Problem p02853 (python)

Fixed submission:
x, y = map(int, input().split())
c = [0]*210
c[1], c[2], c[3] = 3, 2, 1
reword = c[x]+c[y]
if x+y == 2:
    reword += 4

print(reword*100000)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
c = [0]*205
c[1], c[2], c[3] = 3, 2, 1
reword = c[x]+c[y]
if x+y == 2:
    reword += 4

print(reword*100000)
Problem p02936 (python)

Fixed submission:
# 頂点n個 辺iは頂点aiとbiを結ぶ 各頂点には初期値0のカウンターがある
# 操作j: 頂点pjを根とする部分木に含まれるすべてのカウンターにxj足す
# Q回の操作のあと各カウンターの数値を求める

# 方針: 操作の際に最初に部分木の根にだけ点を加え最後に親の点を子に与えていく
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

n, q = map(int, input().split())
connect = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    connect[a-1].append(b-1)
    connect[b-1].append(a-1)

count = [0 for _ in range(n)]
for _ in range(q):
    p, x = map(int, input().split())
    count[p-1] += x


def dfs(now=0, prev=-1):
    kids = connect[now]
    for kid in kids:
        if kid == prev:
            continue
        count[kid] += count[now]
        dfs(kid, now)


dfs()

for i in range(n):
    print(count[i])

Buggy submission (verdict: Runtime Error):
# 頂点n個 辺iは頂点aiとbiを結ぶ 各頂点には初期値0のカウンターがある
# 操作j: 頂点pjを根とする部分木に含まれるすべてのカウンターにxj足す
# Q回の操作のあと各カウンターの数値を求める

n, q = map(int, input().split())
connect = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    connect[a-1].append(b-1)
    connect[b-1].append(a-1)

count = [0 for _ in range(n)]
for _ in range(q):
    p, x = map(int, input().split())
    count[p-1] += x


def dfs(now=0, prev=-1):
    for i in range(len(connect[now])):
        kid = connect[now][i]
        if kid == prev:
            continue
        count[kid] += count[now]
        dfs(kid, now)


dfs()

for i in range(n):
    print(count[i])
Problem p03331 (python)

Fixed submission:
n = input()

m = len(n)
f = 0
ans = 0

for i in range(m):
    ans += int(n[i])
    
    
if m>1 and n[0] == '1':
    if n[1] == '0':
        ans += 9
print(ans)

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

m = len(n)
f = 0
ans = 0

for i in range(m):
    ans += n[i]
    
    
if m>1 and n[0] == 1:
    if n[1] == 0:
        ans += 9
print(ans)
Problem p03988 (python)

Fixed submission:
n = int(input())

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

a = sorted(a)

m = a[-1]
f = 1
if m % 2 == 1:
    s = m // 2 + 1
    count = 0
    if n == 2:
        if a[0] != 1 or a[1] != 1:
            f = 0
    elif a[0] != s or a[2] == s:
        f = 0
    else:
        for i in range(n):
            if a[i] < s:
                continue
            elif a[i] == s:
                if count == 0:
                    count = 1
                else:
                    count = 0
                    s += 1
            else:
                f = 0
                break
        if count == 1:
            f = 0
else:
    s = m // 2 + 1
    count = 0
    if a[0] != s-1 or a[1] == s-1:
        f = 0
    else:
        for i in range(1, n):
            if a[i] < s:
                continue
            elif a[i] == s:
                if count == 0:
                    count = 1
                else:
                    count = 0
                    s += 1
            else:
                f = 0
                break
        if count == 1:
            f = 0
        
if f == 1:
    print('Possible')
else:
    print('Impossible')

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

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

a = sorted(a)

m = a[-1]
f = 1
if m % 2 == 1:
    s = m // 2 + 1
    count = 0
    if a[0] != s or a[2] == s:
        f = 0
    else:
        for i in range(n):
            if a[i] < s:
                continue
            elif a[i] == s:
                if count == 0:
                    count = 1
                else:
                    count = 0
                    s += 1
            else:
                f = 0
                break
        if count == 1:
            f = 0
else:
    s = m // 2 + 1
    count = 0
    if a[0] != s-1 or a[1] == s-1:
        f = 0
    else:
        for i in range(1, n):
            if a[i] < s:
                continue
            elif a[i] == s:
                if count == 0:
                    count = 1
                else:
                    count = 0
                    s += 1
            else:
                f = 0
                break
        if count == 1:
            f = 0
        
if f == 1:
    print('Possible')
else:
    print('Impossible')
Problem p04033 (python)

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

if a > 0:
    print('Positive')
elif b >= 0:
    print('Zero')
elif (b-a) % 2 == 1:
    print('Positive')
else:
    print('Negative')

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

if a > 0:
    print('Positive')
else if b >= 0:
    print('Zero')
else if (b-a) % 2 == 1:
    print('Positive')
else:
    print('Negative')
Problem p04047 (python)

Fixed submission:
n = int(input())

l = list(map(int, input().split()))

ans = 0

l = sorted(l)

for i in range(n):
    ans += l[2*i]
    
print(ans)

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

import sys

sys.setrecursionlimit(20000)

l = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)

def first_search(first, depth):
    record = 0
    for i in l[first]:
        temp = search(first, i, depth-1)
        if record < temp:
            record = temp
    return record + 1

def search(before, now, depth):
    if depth <= 0:
        return 1
    else:
        ans = 1
        for i in l[now]:
            if before != i:
                ans += search(now, i, depth-1)
        return ans

ret = 0    
for i in range(n):
    temp = first_search(i, k)
    if temp > ret:
        ret = temp
        
if ret > n:
    print(0)
else:
    print(n-ret)
Problem p03262 (python)

Fixed submission:
"""
C - Skip
Xを含めた与えられた数列をソートする
最小値を基準０にする
隣同士の差を取る
数列の最大公約数を求める
"""

N, X = map(int, input().split())

numbers = [X]
for part in input().split():
    numbers.append(int(part))

numbers.sort()

# 最小値を基準0とする（ノーマライズ）
min_num = min(numbers)
normal_numbers = []
for num in numbers:
    normal_numbers.append(num - min_num)

# 隣との距離を出す
dist_numbers = []
for i in range(1, len(normal_numbers)):
    # 重複なしで隣との距離を数える
    dist_temp = normal_numbers[i] - normal_numbers[i-1]
    if dist_temp not in dist_numbers:
        dist_numbers.append(dist_temp)

# 最大公約数を求める
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

def gcd_list(numbers):
    if len(numbers) == 1:
        return numbers[0]
    elif len(numbers) == 2: 
        return gcd(numbers[0], numbers[1])
    else:
        return gcd(numbers[0], gcd_list(numbers[1:]))

print(gcd_list(dist_numbers))

Buggy submission (verdict: Runtime Error):
"""
C - Skip
Xを含めた与えられた数列をソートする
最小値を基準０にする
隣同士の差を取る
数列の最大公約数を求める
"""

import math
from functools import reduce

N, X = map(int, input().split())

numbers = [X]
for part in input().split():
    numbers.append(int(part))

numbers.sort()

# 最小値を基準0とする（ノーマライズ）
min_num = min(numbers)
normal_numbers = []
for num in numbers:
    normal_numbers.append(num - min_num)

# 隣との距離を出す
dist_numbers = []
for i in range(1, len(normal_numbers)):
    # 重複なしで隣との距離を数える
    dist_temp = normal_numbers[i] - normal_numbers[i-1]
    if dist_temp not in dist_numbers:
        dist_numbers.append(dist_temp)

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

print(gcd_list(dist_numbers))
Problem p03273 (python)

Fixed submission:
"""
B - Grid Compression
ex in )
4 4
##.#
....
##.#
.#.#

ex out)
###
###
.##
"""

H, W = map(int, input().split())

matrix = []
for h in range(H):
    line = list(input())
    
    line_num = []
    for part in line:
        line_num.append(part)
    
    matrix.append(line_num)

leave_h = []
for h in range(H):
    for w in range(W):
        # 黒ならのこす
        if matrix[h][w] == "#":
            leave_h.append(h)
            break

leave_w = []
for w in range(W):
    for h in range(len(matrix)):
        
        # 黒ならのこす
        if matrix[h][w] == "#":
            leave_w.append(w)
            break


for h in range(H):
    if h not in leave_h:
        continue

    for w in range(W):
        if w not in leave_w:
            continue

        print(matrix[h][w], end="")
    
    print()

Buggy submission (verdict: Runtime Error):
"""
B - Grid Compression
ex in )
4 4
##.#
....
##.#
.#.#

ex out)
###
###
.##
"""

H, W = map(int, input().split())

matrix = []
for h in range(H):
    line = list(input())
    
    line_num = []
    for part in line:
        line_num.append(part)
    
    matrix.append(line_num)

#print(matrix)

cat = 0
for h in range(H):

    leave = False
    for w in range(W):
        
        # 黒ならのこす
        if matrix[h - cat][w] != ".":
            leave = True
            break
    
    if leave is False:
        matrix.pop(h - cat)
        cat += 1
    else:
        pass
        #print(h, "leave")

#print(matrix)

cat = 0
for w in range(W):

    leave = False
    for h in range(len(matrix)):
        
        # 黒ならのこす
        if matrix[h][w - cat] != ".":
            leave = True
            break
    
    if leave is False:
        cat += 1
        for h in range(len(matrix)):
            matrix[h].pop(w)
    else:
        pass
        #print(w, "leave")


for h in range(len(matrix)):
    line = ""
    for w in range(len(matrix[0])):
        line += matrix[h][w]
    print(line)
Problem p03328 (python)

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

diff = b - a

def func(x):
    ret = 0
    while x != 0:
        ret += x
        x -= 1
    return ret

print(func(diff) - b)

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

diff = b - a

def func(x):
    if x == 0:
        return 0
    else:
        return x + func(x - 1)
    
print(func(diff) - b)
Problem p02714 (python)

Fixed submission:
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力<str>
S = input()

R = S.count("R")
G = S.count("G")
B = S.count("B")

cnt = 0

for i in range(N - 2):
  for j in range(i + 1, N - 1):
    k = i + ((j - i) * 2)
    if k < N:
      if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
        cnt += 1

print(R * G * B - cnt)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力<str>
S = input()

ans = 0

for i in range(N - 2):
  S2 = []
  for j in range(N - i - 2):
    if S[i] == S[i + j + 1]:
      continue
    if i + ((j + 1) * 2) < N:
      S2 = S[i + j + 2:i + (2 * j) + 2] + S[i + (2 * j) + 3:]
    else:
      S2 = S[i + j + 2:]
    print("S2 :",S2)
    S2 = S2.replace(S[i], "")
    S2 = S2.replace(S[i + j + 1], "")
    ans += len(S2)

print(ans)
Problem p02882 (python)

Fixed submission:
a, b, x = map(int, input().split())
import math
if x == b * a** 2:
  print(0)
elif x  <= 0.5 * b * a **2:
  print(round(90 - math.degrees(math.atan(2*x / (a * b ** 2))),10))
else:
  print(round(90 - math.degrees(math.atan(a/  (2*(b-x/(a**2)))  )),10))

Buggy submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
import math
if x  <= 0.5 * b * a **2:
  print(round(90 - math.degrees(math.atan(2*x / (a * b ** 2))),10))
else:
  print(round(90 - math.degrees(math.atan(a/  (2*(b-x/(a**2)))  )),10))

Buggy submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
import math
if x  <= 0.5 * b * a **2:
  print(round(90 - math.degrees(math.atan(2*x / (a * b ** 2))),10))
else:
  print(round(90 - math.degrees(math.atan(a/  (2*(b-x/(a**2)))  )),10))

Buggy submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
import math
if x  <= 0.5 * b * a **2:
  print(90 - math.degrees(math.atan(2*x / (a * b ** 2))))
else:
  print(90 - math.degrees(math.atan(a/  (2*(b-x/(a**2)))  )))
Problem p02946 (python)

Fixed submission:
A = list(map(int, input().split()))
for i in range(A[0] * 2 -2):
  print(A[1]-A[0] + i+1, end=' ')
print(A[1]+ A[0] -1 )

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
print(for i in range(A[0] * 2-1): A[1]-A[0] + i)
Problem p03085 (python)

Fixed submission:
b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
else:
  print('C')

Buggy submission (verdict: Runtime Error):
b = input()
if b = 'A':
  print('T')
elif b = 'T':
  print('A')
elif b = 'C':
  print('G')
else:
  print('C')
Problem p03101 (python)

Fixed submission:
A = list(map(int, input().split()))
B = list(map(int, input().split()))
print((A[0]-B[0])*(A[1]-B[1]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [0]*N
B = [0]*N
for i in range(N):
  A[i], B[i] = map(int, input().split())
  
for i in range(N):
  A.insert(2*i+1, B[i])

C = [A[i:i + 2] for i in range(0, len(A), 2)]
C = sorted(C, key=lambda x:(x[0],-x[1]))

hon = 0
kane = 0
for i in range(N):
  if C[i][1] + hon <= M:
    hon += C[i][1]
    kane += C[i][0] * C[i][1]
  else:
    kane += (M - hon) * C[i][0]
    break

print(kane)
Problem p03109 (python)

Fixed submission:
S = input()
T = [c for c in S]
if int(T[0]) * 1000 + int(T[1]) * 100 + int(T[2]) * 10 + int(T[3]) <= 2018 or  (int(T[0]) * 1000 + int(T[1]) * 100 + int(T[2]) * 10 + int(T[3]) == 2019 and int(T[5]) * 1000 + int(T[6]) * 100 + int(T[8]) * 10 + int(T[9]) <= 430 ):
  print('Heisei')
  exit()
print('TBD')

Buggy submission (verdict: Runtime Error):
S = input(S)
T = [c for c in S]
if int(T[0]) * 1000 + int(T[1]) * 100 + int(T[2]) * 10 + int(T[3]) <= 2018 or  (int(T[0]) * 1000 + int(T[1]) * 100 + int(T[2]) * 10 + int(T[3]) == 2019 and int(T[5]) * 1000 + int(T[6]) * 100 + int(T[8]) * 10 + int(T[9]) <= 430 ):
  print('Heisei')
  exit()
print('TBD')
Problem p03136 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
if sum(L)  <=  max(L)*2:
  print('No')
  exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
for i in range(N):
  if sum(L) - L(i) <= L(i):
    print('No')
    exit()
print('Yes')
Problem p03260 (python)

Fixed submission:
A, B = map(int, input().split())
if A * B % 2 == 0:
  print('No')
  exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())
if A * B % 2 == 0:
  print('No')
  exit()
print('Yes')
Problem p03289 (python)

Fixed submission:
S = input()
if S[0] != 'A':
  print('WA')
  exit()
count = 0
if len(S) < 4:
  print('WA')
  exit()
for i in range(len(S) - 3):
  if S[i+2] == 'C':
    count += 1
  elif S[i+2].islower():
    continue
  else:
    print('WA')
    exit()
if S[1].isupper() or S[-1].isupper():
  print('WA')
  exit()
if count == 1:
  print('AC')
  exit()
print('WA')

Buggy submission (verdict: Runtime Error):
S = input()
if S[0] != 'A':
  print('WA')
  exit()
count = 0
if len(S) < 4:
  print('WA')
  exit()
for i in range(len(S) - 3):
  if S[i+2] == 'C':
    count += 1
  elif S[i+2].islower():
    continue
  else:
    print('WA')
    exit()
if A[1].isupper() or A[-1].isupper():
  print('WA')
  exit()
if count == 1:
  print('AC')
  exit()
print('WA')
Problem p03351 (python)

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

if max(abs(A[0]-A[1]),abs(A[1]-A[2])) <= A[3] or abs(A[0]-A[2]) <= A[3]:
  print('Yes')
  exit()
print('No')

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

if max(abs(A[0]-A[1]),abs(A[1]-A[2])) <= d or abs(A[0]-A[2]) <= d:
  print('Yes')
  exit()
print('No')
Problem p03352 (python)

Fixed submission:
x = int(input())
if x < 4:
  print(1)
  exit()
import math
result = 1
for i in range(2,x+1):
  if math.floor(math.log(x,i)+1/100000) > 1:
    result = max(result, i ** math.floor(math.log(x,i)+1/100000))
  
print(result)

Buggy submission (verdict: Runtime Error):
x = int(input())
if x < 4:
  print(1)
  exit()
import math
for i in range(2,x):
  if math.floor(math.log(x,i))>1:
    result = max(result, i ** math.floor(math.log(x,i)))
print(result)
Problem p03369 (python)

Fixed submission:
S = [x for x in input()]
print(700 + 100 * S.count('o'))

Buggy submission (verdict: Runtime Error):
S = [x for x in int()]
print(700 + 100 * S.count('o'))
Problem p03385 (python)

Fixed submission:
S = input()
if S.count('a') == 1 and S.count('b') == 1:
  print('Yes')
  exit()
print('No')

Buggy submission (verdict: Runtime Error):
S = input()
if S.len('a') == 1 and S.len('b') == 1:
  print('Yes')
  exit()
print('No')
Problem p03415 (python)

Fixed submission:
A = input()
B = input()
C = input()
print(A[0] + B[1] + C[2])

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
prin(A[0] + B[1] + C[2])
Problem p03543 (python)

Fixed submission:
a,b,c,d = input()
print('Yes' if (a == b and b == c ) or (b == c and c == d ) else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c,d = input()
print('Yes' if (a == b and b == c ) or (b == c and C == d ) else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c,d = input()
print('Yes' if (a == b and b == c ) or (b == c and C == d ) else 'No')
Problem p03679 (python)

Fixed submission:
X, A, B = map(int, input().split())
if B-A > X:
  print('dangerous')
  exit()
elif B <= A:
  print('delicious')
  exit()
print('safe')

Buggy submission (verdict: Runtime Error):
X, A, B = map(int, input())
if A-B > X:
  print('dangerous')
  exit()
elif A-B <= 0:
  print('delicious')
  exit()
print('safe')
Problem p03693 (python)

Fixed submission:
A = list(map(int, input().split()))
print('YES' if (A[1]*10+A[2])%4 ==0 else 'NO')

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
print('YES' if int(A[1]+A[2])%4 ==0 else 'NO')
2 3 4

Buggy submission (verdict: Runtime Error):
A = list(map(int, input()))
print('YES' if int(A[1]+A[2])%4 ==0 else 'NO')
Problem p03712 (python)

Fixed submission:
h, w = map(int, input().split())
x = [0]*h
for i in range(h):
  x[i] = input()

for i in range(w+1):
  print('#', end='')
print('#')
for i in range(h):
  print('#' + x[i] + '#')

for i in range(w+2):
  print('#', end='')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
x = [0]*h
for i in range(h):
  x[i] = input()

for i in range(w+):
  print('#', end='')
print('#')
for i in range(h):
  print('#' + x[i] + '#')

for i in range(w+2):
  print('#', end='')
Problem p03737 (python)

Fixed submission:
A, B, C = map(str, input().split())
print((A[0]+B[0]+C[0]).upper())

Buggy submission (verdict: Runtime Error):
A, B, C = map(str, input().split())
print(A.upper[0]+B.upper[0]+C.upper[0])
Problem p03777 (python)

Fixed submission:
a, b = map(str, input().split())
if a =='H' and b =='H':
  print('H')
elif a =='H' and b =='D':
  print('D')
elif a =='D' and b =='H':
  print('D')
else:
  print('H')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a =='H' and b =='H':
  print('H')
elif a =='H' and b =='D':
  print('D')
elif a =='D' and b =='H':
  print('D')
else:
  print('H')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a ='H' and b ='H':
  print('H')
elif a ='H' and b ='D':
  print('D')
elif a ='D' and b ='H':
  print('D')
else:
  print('H')
Problem p03852 (python)

Fixed submission:
a = input()
for i in 'aiueo':
  if a == i:
    print('vowel')
    exit()
print('consonant')

Buggy submission (verdict: Runtime Error):
a = input()
for i in range('aiueo'):
  if a == i:
    print('vowel')
    exit()
print('consonant')

Buggy submission (verdict: Runtime Error):
a = input()
for i in range('aiueo'):
  if a = i:
    print('vowel')
    exit()
print('consonant')
Problem p03860 (python)

Fixed submission:
A = list(map(str, input().split()))
print(A[0][0] + A[1][0] + A[2][0])

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
print(A[0][0] + A[1][0] + A[2][0])
Problem p03943 (python)

Fixed submission:
a = list(map(int, input().split()))
print('Yes' if max(a) *2 == sum(a) else 'No')

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
print('Yes' if max(a) *2 = sum(a) else 'No')