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

Fixed submission:
s = input()
k = int(input())
flag = 1
for i in range(min(k,len(s))):
    if s[i]!='1':
        flag = 0
        a = s[i]
        break
if flag:
    print(1)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
flag = 1
for i in range(min(k,len(s))):
    if s[i]!='1':
        flag = 0
        break
if flag:
    print(1)
else:
    print(s[1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
flag = 1
for i in range(min(k,s)):
    if s[i]!='1':
        flag = 0
        break
if flag:
    print(1)
else:
    print(s[1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
flag = 1
for i in range(k):
    if s[i]!='1':
        flag = 0
        break
if flag:
    print(1)
else:
    print(s[1])
Problem p03294 (python)

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

f = sum(a)-N
print(f)

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce


def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


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

mod = []
for m in range(lcm(a)):
    k = [m % a[i] for i in range(N)]
    mod.append(sum(k))
print(max(mod))
Problem p03361 (python)

Fixed submission:
import sys

h,w = map(int,input().split())
C = [input() for _ in range(h)]

dd = [(0,1),(0,-1),(1,0),(-1,0)]
for i in range(h):
    for j in range(w):
        if C[i][j] == '#':
            b = []
            for di,dj in dd:
                if 0<=i+di<h and 0<=j+dj<w:
                    b.append(C[i+di][j+dj] == '.')
            if all(b):
                print('No')
                sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
h,w = ri()
C = [input() for _ in range(h)]

dd = [(0,1),(0,-1),(1,0),(-1,0)]
for i in range(h):
    for j in range(w):
        if C[i][j] == '#':
            b = []
            for di,dj in dd:
                if 0<=i+di<h and 0<=j+dj<w:
                    b.append(C[i+di][j+dj] == '.')
            if all(b):
                print('No')
                sys.exit()
print('Yes')
Problem p03459 (python)

Fixed submission:
import sys
n = int(input())
pt, px, py = 0, 0, 0
for _ in range(n):
    t, x, y = map(int,input().split())
    dt = abs(t-pt)
    dx = abs(x-px)
    dy = abs(y-py)
    if dt<dx+dy or dt%2!=(dx+dy)%2:
        print('No')
        sys.exit()    
    pt,px,py = t,x,y
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
pt, px, py = 0, 0, 0
for _ in range(n):
    t, x, y = map(int,input().split())
    dt = abs(t-pt)
    dx = abs(x-px)
    dy = abs(y-py)
    if dt<dx+dy or dt%2!=(dx+dy)%2:
        print('No')
        sys.exit()    
    pt,px,py = t,x,y
print('Yes'
Problem p03480 (python)

Fixed submission:
s = input()
n = len(s)

t = [n]
for i in range(1, n):
    if s[i] != s[i-1]:
        t.append(max(i, n-i))
print(min(t))

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

t = []
for i in range(1, n):
    if s[i] != s[i-1]:
        t.append(max(i, n-i))
print(min(t))
Problem p03552 (python)

Fixed submission:
ai = lambda: list(map(int,input().split()))
n, z, w = ai()
a = ai()
if n == 1:
    print(abs(a[-1]-w))
else:
    print(max(abs(a[-1]-w), abs(a[-1]-a[-2])))

Buggy submission (verdict: Runtime Error):
ai = lambda: list(map(int,input().split()))
n, z, w = ai()
a = ai()
if n == a:
    print(abs(a[-1]-w))
else:
    print(max(abs(a[-1]-w), abs(a[-1]-a[-2])))
Problem p03627 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
f,s,i = 0,0,0
while i+1<n:
    if a[i]==a[i+1]:
        s = f
        f = a[i]
        i += 1
    i += 1
print(f*s)

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

ans = 3
i = 0
if a[0] != b[0]:
    i += 1
    ans += 3

while i < n-1:
    if a[i]==b[i]:
        if a[i+1]==b[i+1]:
            ans *= 2
        else:
            ans *= 2
            i += 1
    else:
        if a[i+1]==b[i+1]:
            ans *= 1
        else:
            ans *= 3
            i += 1
    i += 1
    ans %= 1000000007
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
u = list(set(a))
u = [i for i in u if a.count(i)>1]
print(u[-1]*u[-2])
Problem p03675 (python)

Fixed submission:
f = lambda: list(map(int,input().split()))
n = int(input())
a = f()
if n&1:
    b = a[::-2]+a[1::2]
else:
    b = a[::-2]+a[::2]
print(*b)

Buggy submission (verdict: Runtime Error):
ai = lambda: list(map(int,input().split()))
ai_ = lambda: [int(x)-1 for x in input().split()]


n = int(input())
a = ai()
MOD = 10**9+7

from collections import Counter
dup = list(Counter(sorted(a)).values()).index(2)+1
ant = a.index(dup)
post = a[::-1].index(dup)


def nCb(n, r):
    fac = [1, 1] + [0] * n
    finv = [1, 1] + [0] * n
    inv = [0, 1] + [0] * n
    for i in range(2, n + 2):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = -inv[MOD % i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD
        
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD


for k in range(1,n+2):
    if k == 1:
        print(n)
    else:
        ans = nCb(n+1,k)
        if ant+post+1 >= k:
            ans -= nCb(ant+post,k-1)
        print(ans)
Problem p03687 (python)

Fixed submission:
s = input()
n = 0
ans = 10**10
for k in 'qwertyuiopasdfghjklzxcvbnm':
    l = [i if i == k else 0 for i in s]
    a = 0
    while l.count(k)!=len(l):
        for i in range(len(l)-1):
            if l[i]==k or l[i+1]==k:
                l[i] = k
        a += 1
        l.pop(-1)
    ans = min(ans,a)
    n += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
s = input()
n = 0
ans = 10**10
while n<len(s) and Counter(s).most_common()[n][1]==Counter(s).most_common()[0][1]:
    k = Counter(s).most_common()[n][0]
    l = [i if i == k else 0 for i in s]
    a = 0
    while l.count(k)!=len(l):
        for i in range(len(l)-1):
            if l[i]==k or l[i+1]==k:
                l[i] = k
        a += 1
        l.pop(-1)
    ans = min(ans,a)
    n += 1
print(ans)
Problem p03701 (python)

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]
if sum(s)%10:
    print(sum(s))
else:
    for i in sorted(s):
        if i%10:
            print(sum(s)-i)
            break
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [int(input()) for i in range(n)]
if sum(s)%10:
    print(sum(s))
else:
    for i in sorted(s):
        if i%10:
            print(sum(s)-i)
            break
    else:
        print(0
Problem p03722 (python)

Fixed submission:
ai_ = lambda: [int(x)-1 for x in input().split()]
ai = lambda: list(map(int, input().split()))

n,m = ai()

from collections import defaultdict as dd
edge = dd(list)
for _ in range(m):
    a,b,c = ai()
    edge[a-1].append([b-1, -c])

dist = [float('inf')] * n
dist[0] = 0

for i in range(n):
    for cur_v in range(n):
        for v, c in edge[cur_v]:
            if dist[v] > dist[cur_v] + c:
                dist[v] = dist[cur_v] + c
                if i == n-1 and v == n-1:
                    print('inf')
                    exit()
print(-dist[-1])

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

n,m = ai()
edge = []
for _ in range(m):
    a,b,c = ai()
    edge.append((a-1, b-1, -c))

import networkx as nx
G = nx.DiGraph()
G.add_weighted_edges_from(edge)
if nx.negative_edge_cycle(G):
    print('inf')
else:
    print(-nx.bellman_ford_path_length(G, source=0, target=n-1))

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

n,m = ai()
edge = []
for _ in range(m):
    a,b,c = ai()
    edge.append((a-1, b-1, -c))

import networkx as nx
G = nx.DiGraph()
G.add_weighted_edges_from(edge)
if nx.negative_edge_cycle(G):
    print('inf')
else:
    print(-nx.bellman_ford_path_length(G, source=0, target=n-1))
Problem p03764 (python)

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

n,m = ai()
x = ai()
y = ai()
mod = 10**9+7
ans = 0

sx,ssx,sy,ssy = [x[0]], [x[-1]], [y[0]], [y[-1]]
for i in range(1, n):
    sx.append(sx[-1] + x[i])
    ssx.append(ssx[-1] + x[-i-1])
for i in range(1, m):
    sy.append(sy[-1] + y[i])
    ssy.append(ssy[-1] + y[-i-1])

a = sum(ssx[i] - sx[i] for i in range(n)) % mod
b = sum(ssy[i] - sy[i] for i in range(m)) % mod

ans = a*b % mod
print(ans)

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

n,m = ai()
x = ai()
y = ai()
mod = 10**9+7
ans = 0

sx,ssx,sy,ssy = [x[0]], [x[-1]], [y[0]], [y[-1]]
for i in range(1, n):
    sx.append(sx[-1] + x[i])
    ssx.append(ssx[-1] + x[-i-1])
    sy.append(sy[-1] + y[i])
    ssy.append(ssy[-1] + y[-i-1])

a = sum(ssx[i] - sx[i] for i in range(n)) % mod
b = sum(ssy[i] - sy[i] for i in range(n)) % mod

ans = a*b % mod
print(ans)
Problem p03848 (python)

Fixed submission:
f = lambda: list(map(int,input().split()))
mod = 10**9+7

n = int(input())
a = sorted(f())
if n&1:
    if all([a[i] == i+i%2 for i in range(n)]):
        print(2**(n//2)%mod)
    else:
        print(0)
else:
    if all([a[i] == i+(i+1)%2 for i in range(n)]):
        print(2**(n//2)%mod)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7

n = int(input())
a = sorted(f())
if n&1:
    if all([a[i] == i+i%2 for i in range(n)]):
        print(1<<((n-1)//2)%mod)
    else:
        print(0)
else:
    if all([a[i] == i+(i+1)%2 for i in range(n)]):
        print(1<<(n//2)%mod)
    else:
        print(0)
Problem p03879 (python)

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

import numpy as np
import math


def calc(A,B,C):
    a = np.linalg.norm(B - C)
    b = np.linalg.norm(C - A)
    c = np.linalg.norm(A - B)
    s = (a + b + c) / 2
    area = (s * (s - a) * (s - b) * (s - c)) ** 0.5
    r = 2 * area / (a + b + c)
    m = max(a,b,c)
    return m/(2+m/r)


a = np.array(ai())
b = np.array(ai())
c = np.array(ai())
print(calc(a,b,c))

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


def calc(A,B,C):
    a = np.linalg.norm(B - C)
    b = np.linalg.norm(C - A)
    c = np.linalg.norm(A - B)
    cosC = np.inner(A-C, B-C)/(b*a)
    if cosC <= 0:
        return 0
    tanC = math.sqrt(1/(cosC**2)-1)
    return (1 - 1/cosC + tanC) * (a+b-c)/4


a = np.array(ai())
b = np.array(ai())
c = np.array(ai())
print(max(calc(a,b,c),calc(b,c,a),calc(c,a,b)))
Problem p04039 (python)

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

while True:
    m = list(str(N))
    f = 0
    for i in d:
        if str(i) in m:
            f += 1
    if f == 0:
        print(N)
        break
    N += 1

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

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2
ans %= mod

for i in range(1, bb+1):
    c1 = c1 * (aa + b + i) * inv(b + i) % mod
    c2 = c2 * (bb - i + 1) * inv(a + bb - i) % mod
    ans += c1 * c2
    ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
ai = lambda: list(map(int,input().split()))
ai_ = lambda: [int(x)-1 for x in input().split()]

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2
ans %= mod

for i in range(1, bb+1):
    c1 = c1 * (aa + b + i) * inv(b + i) % mod
    c2 = c2 * (bb - i + 1) * inv(a + bb - i) % mod
    ans += c1 * c2
    ans %= mod
print(ans)
Problem p03694 (python)

Fixed submission:
aa = input()
arr = list(map(int,input().split(" ")))
mx=arr[0]
mn=arr[0]
for aaa in arr:
  if(mx<aaa):
    mx=aaa
  elif(mn>aaa):
    mn=aaa

print(mx-mn)

Buggy submission (verdict: Runtime Error):
arr = map(int,input().split(" "))
mx=arr(0)
mn=arr(0)
for a in srr:
  if(mx<a):
    mx=a
  else if(mn>a):
      mn=a

      print(mx-mn)
Problem p03852 (python)

Fixed submission:
a = input()
if( a== "a" or a=="i" or a=="u" or a=="e" or a=="o" ):
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre) ):
        a = a[:len(a)-7]
	elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)
Problem p03854 (python)

Fixed submission:
dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre)):
        a = a[:len(a)-7]
    elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)

Buggy submission (verdict: Runtime Error):
dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre) ):
        a = a[:len(a)-7]
	elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)
Problem p04029 (python)

Fixed submission:
n =int(input())
print((n+1) * n //2)

Buggy submission (verdict: Runtime Error):
n =input()
print((n+1) * n //2)
Problem p04031 (python)

Fixed submission:

dv = int(input())
l_si = input().split(" ")
l_si_i = [int(s) for s in l_si]

sm = sum(l_si_i)
av = round(sm /dv)
ret = 0

for it in l_si_i:
  ret = ret + (it -av) **2


print(ret)

Buggy submission (verdict: Runtime Error):
l_si = input().split(" ")
l_si_i = [int(s) for s in l_si]

sm = sum(l_si_i)
av = round(sm /dv)
ret = 0

for it in l_si_i:
  ret = ret + (it -av) **2


print(ret)
Problem p04043 (python)

Fixed submission:
arr_str = input().split(" ")
ans = 0
for a in arr_str:
    if(a == "5"):
        ans = ans + 1
    elif(a=="7"):
        ans =ans +10

if( ans == 12):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
a = [input() for i in range(arr_len_int)]
a.sort()
b = set(a)
print(''.join(b ))
Problem p04044 (python)

Fixed submission:
arr_len_int = int(input().split(' ')[0])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))

Buggy submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))

Buggy submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
a = [input() for i in range(arr_len_int)]
a.sort()
print(''.join(a ))

Buggy submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
a = [input() for i in range(arr_len_int)]
a.sort()
b = set(a)
print(''.join(b ))
Problem p03455 (python)

Fixed submission:
def odd_even():
    i = list(map(int, input().split()))
    if (i[0] * i[1]) % 2 == 0:
        print('Even')
    else:
        print('Odd')

if __name__=='__main__':
    odd_even()

Buggy submission (verdict: Runtime Error):
def odd_even():
    i = list(map(int, input().split()))
    if (i[0] * i[1]) % 2 == 0:
        print('Even')
    else:
        print('Odd')

if __name__=__main__:
    odd_even()
Problem p02947 (python)

Fixed submission:
import collections
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


n = int(input())
s = [''.join(sorted(input())) for i in range(n)]
c = collections.Counter(s)
count = list(c.values())
ans = 0
for num in count:
    if num >= 2:
        b = cmb(num, 2)
        ans += int(b)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
from math import factorial
n = int(input())
s = [''.join(sorted(input())) for i in range(n)]
c = collections.Counter(s)
count = list(c.values())
ans = 0
for num in count:
    if num >= 2:
        b = factorial(num) / factorial(2) / factorial(num - 2)
        ans += int(b)
print(ans)
Problem p02952 (python)

Fixed submission:
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    if int(n) <= 9:
        print(int(n))
    else:
        length = len(n)
        b = '9' * (length-1)
        c = int(n) - int(b)
        ans += c
        for i in range(length-2, -1, -2):
            if i == 1:
                ans += 9
            else:
                plus = '9' * i
                minus = '9' * (i-1)
                ans += (int(plus) - int(minus))
        print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    length = len(n)
    b = '9' * (length-1)
    c = int(n) - int(b)
    ans += c
    for i in range(length-2, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i-1)
            ans += (int(plus) - int(minus))
    print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    length = len(n)
    ans += (int(n[1:])+1)
    for i in range(length-2, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i-1)
            ans += (int(plus) - int(minus))
    print(ans)
Problem p03076 (python)

Fixed submission:
list = [int(input()) for i in range(5)]
ans = 0
amari = []
for i in range(5):
  ans += (list[i] // 10) * 10
  amari.append(list[i] % 10)
amari = sorted(amari)
for i in range(5):
  if amari[i] != 0:
    ans += amari[i]
    ans += (5-(i+1)) * 10
    break
print(ans)

Buggy submission (verdict: Runtime Error):
list = [int(input()) for i in range(5)]
min = 9
ans = 0
zero_count = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0 and amari < min:
    min = amari
    num_min = i
  elif amari == 0:
    zero_count += 1
if zero_count == 5:
  num_min = 0
for i in range(5):
  if i != num_min:
    if list[i] % 10 == 0:
      ans += list[i]
    else:
      ans += (list[i] // 10 + 1) * 10
  elif i == num_min:
    ans += list[i]
print(ans)

Buggy submission (verdict: Runtime Error):
list = [int(input()) for i in range(5)]
min = 9
ans = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0 and amari < min:
    min = amari
    num_min = i
for i in range(5):
  if i != num_min:
    if list[i] % 10 == 0:
      ans += list[i]
    else:
      ans += (list[i] // 10 + 1) * 10
  elif i == num_min:
    ans += list[i]
print(ans)

Buggy submission (verdict: Runtime Error):
list = [int(input()) for i in range(5)]
min = 9
ans = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0:
    if amari < min:
      min = amari
      num_min = i
for i in range(5):
  if i != num_min:
    ans += int(round(list[i], -1))
  else:
    ans += list[i]
print(ans)
Problem p03239 (python)

Fixed submission:
n, t = map(int, input().split())
cost = []
time = []
for i in range(n):
    c, ti = map(int, input().split())
    if ti <= t:
        cost.append(c)
        time.append(ti)
cost = sorted(cost)
if time != []:
    print(cost[0])
else:
    print('TLE')

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
cost = []
for i in range(n):
    c, ti = map(int, input().split())
    if ti <= t:
        cost.append(c)
cost = sorted(cost)
print(cost[0])
Problem p03273 (python)

Fixed submission:
h, w = map(int, input().split())
a = [input() for _ in range(h)]
row = [False] * h
col = [False] * w

for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            row[i] = True
            col[j] = True

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j], end='')
        print()

Buggy submission (verdict: Runtime Error):
miss
Problem p03547 (python)

Fixed submission:
x, y = input().split()
if x < y:
    print("<")
elif x > y:
    print(">")
else:
    print("=")

Buggy submission (verdict: Runtime Error):
def ctoi(x):
  if x == 'A':
    x = 10
  elif x == 'B':
    x = 11
  elif x == 'C':
    x = 12
  elif x == 'D':
    x = 13
  elif x == 'E':
    x = 14
  else:
    x = 15
x, y = input().split()
x = ctoi(x)
y = ctoi(y)
if x > y:
  print('>')
elif x < y:
  print('<')
else:
  print('=')
Problem p03573 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a == b:
  print(c)
elif a == c:
  print(b)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input())
if a == b:
  print(c)
elif a == c:
  print(b)
else:
  print(a)
Problem p04043 (python)

Fixed submission:
a = list(map(int, input().split()))
if a.count(5) == 2 and a.count(7) == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 18 13:12:09 2019

@author: reimu
"""

a = map(list, input().split())
if a.count('5') == 2 and a.count('7') == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 18 13:12:09 2019

@author: reimu
"""

a = map(list, input().split())
if a.count(5) == 2 and a.count(7) == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 18 13:12:09 2019

@author: reimu
"""

a = map(int, input().split())
if a.count(5) == 2 and a.count(7) == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 18 13:12:09 2019

@author: reimu
"""

a = map(int, input().split())
if a.count(5) == 2 and a.count(7):
    print('YES')
else:
    print('NO')
Problem p04044 (python)

Fixed submission:
n, l = map(int, input().split())
list = []
for i in range(n):
    list.append(input())
list.sort()
s = ''.join(list)
print(s)

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
lists = []
for i in range(n):
    list.apend(input())
lists.sort()
s = ''
for list in lists:
    s += list
print(s)

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
lists = []
for i in n:
    list.apend(input())
lists.sort()
s = ''
for list in lists:
    s += list
print(s)