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

Fixed submission:
import sys

def match(a, b):
    for i in range(len(a)):
        if a[i] != '?' and b[i] != '?' and a[i] != b[i]:
            return False
    return True


Y=str(input())
T=str(input())
S = ''
if len(Y) < len(T):
    print('UNRESTORABLE')
    sys.exit()

if match(T,Y[-len(T):]):
    S = Y[:-len(T)] + T
    A = S.replace('?','a')
    print(A)
    sys.exit()
else:
    for i in range(len(Y) - len(T)):
        i += 1
        k = -(len(T)+i)
        if match(T, Y[k:-i]):
            S = Y[:k] + T + Y[-i:]
            A = S.replace('?','a')
            print(A)
            sys.exit()

print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
import sys

def match(a, b):
    for i in range(len(a)):
        if a[i] != '?' and b[i] != '?' and a[i] != b[i]:
            return False
    return True


Y=str(input())
T=str(input())
S = ''
if match(T,Y[-len(T):]):
    S = Y[:-len(T)] + T
    A = S.replace('?','a')
    print(A)
    sys.exit()
else:
    for i in range(len(Y) - len(T)):
        i += 1
        k = -(len(T)+i)
        if match(T, Y[k:-i]):
            S = Y[:k] + T + Y[-i:]
            A = S.replace('?','a')
            print(A)
            sys.exit()

print('UNRESTORABLE')
Problem p03569 (python)

Fixed submission:
import sys
S = str(input())
i = 0
j = len(S) - 1
c = 0
while(True):
    if i >= j:
        break
    if (S[i] == S[j]):
        i += 1
        j -= 1
    else:
        if (S[i] == 'x'):
            i += 1
            c += 1
        elif (S[j] == 'x'):
            j -= 1
            c += 1
        else:
            print('-1')
            sys.exit()
print(c)

Buggy submission (verdict: Runtime Error):
import sys
S = str(input())
i = 0
j = len(S) - 1
c = 0
while(True):
    if i == j:
        break
    if (S[i] == S[j]):
        i += 1
        j -= 1
    else:
        if (S[i] == 'x'):
            i += 1
            c += 1
        elif (S[j] == 'x'):
            j -= 1
            c += 1
        else:
            print('-1')
            sys.exit()
print(c)
Problem p03574 (python)

Fixed submission:
def get_bomb_num(i, j):
    cnt = 0
    for p in range(-1,2):
        for s in range(-1,2):
            l = i + p
            m = j + s
            if (p == 0 and s == 0) or (l < 0) or (l >= H) or (m < 0) or (m >= W):
                continue
            if b[l][m] == '#':
                cnt += 1
    return cnt

H,W = list(map(int, input().split()))
b =[]
for i in range(H):
    b.append(str(input()))

for i in range(H):
    for j in range(W):
        if b[i][j] == '#':
            print('#', end ='')
        else:
            print(get_bomb_num(i,j), end='')
    print('')

Buggy submission (verdict: Runtime Error):
def get_bomb_num(i, j):
    cnt = 0
    for p in range(-1,2):
        for s in range(-1,2):
            l = i + p
            m = j + s
----
            if (p == 0 and s == 0) or (l < 0) or (l >= H) or (m < 0) or (m >= W):
                continue--
            if b[l][m] == '#':
                cnt += 1
    return cnt

H,W = list(map(int, input().split()))
b =[]
for i in range(H):
    b.append(str(input()))

for i in range(H):
    for j in range(W):
        if b[i][j] == '#':
            print('#', end ='')
        else:
            print(get_bomb_num(i,j), end='')
    print('')
Problem p03609 (python)

Fixed submission:
X, t = list(map(int, input().split(' ')))
print(X - t if (X - t) >= 0 else 0)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int, input().split(' ')))
d = {}
for l in ls:
    if l in d:
        d[l] += 1
    else:
        d[l] = 1

m = 0
for k in range(1, 100002):
    if k in d:
        c += d[k]
    if (k-1) in d:
        c += d[k-1]
    if (k+1) in d:
        c += d[k+1]
    m = max(m,c)
print(m)
Problem p03611 (python)

Fixed submission:
N = int(input())
ls = list(map(int, input().split(' ')))
d = {}
for l in ls:
    if l in d:
        d[l] += 1
    else:
        d[l] = 1

m = 0
keys = sorted(d.keys())
for k in keys:
    c = d[k]
    if (k-1) in d:
        c += d[k-1]
    if (k+1) in d:
        c += d[k+1]
    m = max(m,c)
print(m)

Buggy submission (verdict: Runtime Error):

N = int(input())
ls = list(map(int, input().split(' ')))
d = {}
for l in ls:
    if l in d:
        d[l] += 1
    else:
        d[l] = 1

m = 0
for k in range(1, 100002):
    if k in d:
        c += d[k]
    if (k-1) in d:
        c += d[k-1]
    if (k+1) in d:
        c += d[k+1]
    m = max(m,c)
print(m)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = list(map(int, input().split(' ')))
d = {}
for l in ls:
    if l in d:
        d[l] += 1
    else:
        d[l] = 1

m = 0
keys = sorted(d.keys())
for k in keys:
    c = d[k]
    if (k-1) in d:
        c += d[k-1]
    if (k+1) in d:
        c += d[k+1]
    m = max(m,c)
print(m)
N = int(input())
ls = list(map(int, input().split(' ')))
d = {}
for l in ls:
    if l in d:
        d[l] += 1
    else:
        d[l] = 1

m = 0
for k in range(1, 100002):
    if k in d:
        c += d[k]
    if (k-1) in d:
        c += d[k-1]
    if (k+1) in d:
        c += d[k+1]
    m = max(m,c)
print(m)
Problem p03625 (python)

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

counter = {}

for i in l:
    if i in counter:
        counter[i] = counter[i] + 1
    else:
        counter[i] = 1

a = None
b = None
for k in sorted(counter.keys(), reverse=True):
    if counter[k] >= 4 and a == None and b == None:
        a = k
        b = k
    elif counter[k] >= 2 and a == None:
        a = k
    elif counter[k] >= 2 and a != None:
        b = k
    if (a != None and b != None):
        break

if (a != None and b!= None):
    print(a * b)
else:
    print('0')

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

counter = {}

for i in l:
    if i in counter:
        counter[i] = counter[i] + 1
    else:
        counter[i] = 1

a = None
b = None
for k in sorted(counter.keys(), reverse=True):
    if counter[k] >= 4 and a == None and b == None:
        a , b = k
    elif counter[k] >= 2 and a == None:
        a = k
    elif counter[k] >= 2 and a != None:
        b = k
    if (a != None and b != None):
        break

if (a != None and b!= None):
    print(a * b)
else:
    print('0')
Problem p03632 (python)

Fixed submission:
ls = list(map(int, input().split()))
A = ls[0]
B = ls[1]
C = ls[2]
D = ls[3]

k = [ i for i in range(0,101) if A <= i <= B and C <= i <= D]
if not k:
    print(0)
else:
    print(max(k) - min(k))

Buggy submission (verdict: Runtime Error):
ls = list(map(int, input().split()))
A = ls[0]
B = ls[1]
C = ls[2]
D = ls[3]

k = [ i for i in range(0,101) if A <= i <= B and C <= i <= D]
print(max(k) - min(k))

Buggy submission (verdict: Runtime Error):
ls = list(map(int, input().split()))
A = ls[0]
B = ls[1]
C = ls[2]
D = ls[3]

k = [ i for i in range(0,101) if A <= i <= B and C <= i <= D]
print(max(k) - min(k))
Problem p03633 (python)

Fixed submission:
from functools import reduce

#def gcd(a, b):
#    while b:
#        a, b = b, a % b
#    return a

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(a, b):
    return a * b // gcd(a,b)

N = int(input())
Ts = []
c = 1
for i in range(N):
    c = lcm(c, int(input()))

print(int(c))

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

 def gcd(a, b):
     while b:
         a, b = b, a % b
     return a

 def lcm(a, b):
     return a * b / gcd(a,b)

 N = int(input())
 Ts = []
 for i in range(N):
     Ts.append(int(input()))

 c = 1
 for T in Ts:
     c = lcm(c, T)

 print(int(c))
Problem p03639 (python)

Fixed submission:
import sys

N = int(input())
ls = list(map(int, input().split()))
k = len(ls)
p = [ i for i in ls if (i%4) == 0]
j = [ i for i in ls if (i%4) != 0]
r = [ i for i in j if (i%2) == 0]

if(len(p) >= int(k/2)):
    print('Yes')
elif (len(p) >= (len(j) - len(r))):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys

N = int(input())
ls = list(map(int, input().split()))
k = len(ls)
p = [ i for i in ls if (i%4) == 0]
j = [ i for i in ls if (i%4) != 0]
r = [ i for i in j if (i%2) == 0]

if(len(p) >= int(k/2)):
    print('Yes')
elif (len(p) >= (len(j) - len(r))):
    print('Yes')
else:
    print('No')
----
Problem p03687 (python)

Fixed submission:
def check(s, S):
    for i in S:
        if (i != s):
            return True
    return False

S = str(input())
T = S

m = 1000
for s in S:
    num = 0
    T = S
    while (check(s, T)):
        num += 1
        K = []
        for i in range(0, len(T) - 1):
            if s == T[i+1]:
                K.append(T[i+1])
            else:
                K.append(T[i])
        T = K
    m = min(m, num)

print(m)

Buggy submission (verdict: Runtime Error):

 S = str(input())

 c = 0
 ma = 0
 for i in S:
     c = 0
     for k,j in enumerate(S):
         if ( k != 0 and k != len(S) and j != i and S[k-1] != a and S[k+1] != a):
             c += 1
     ma = min(ma, c)

 print(ma)

Buggy submission (verdict: Runtime Error):

S = str(input())

c = 0
ma = 0
for i in S:
    c = 0
    for k,j in enumerate(S):
        if ( k != 0 and k != N-1 and j != i and S[k-1] != a and S[k+1] != a):
            c += 1
    ma = min(ma, c)

print(ma)
Problem p03719 (python)

Fixed submission:
nums = list(map(int, input().split()))
t = nums[2]
if (nums[0] <= t and nums[1] >= t):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
 nums = list(map(int, input().split()))
 t = nums[2]
 if (nums[0] <= t and nums[1] >= t):
     print('Yes')
 else:
     print('No')
Problem p03760 (python)

Fixed submission:
O = str(input())
E = str(input())

ma = max(len(O), len(E))

for i in range(ma):
    if (i < len(O)):
        print(O[i], end="")
    if (i < len(E)):
        print(E[i], end="")

Buggy submission (verdict: Runtime Error):
N = int(input())
Ts = list(map(int, input().split()))
M = int(input())
Ds = []
O = str(input())
E = str(input())

ma = max(len(O), len(E))

for i in range(ma):
    if (i < len(O)):
        print(O[i], end="")
    if (i < len(E)):
        print(E[i], end="")

Buggy submission (verdict: Runtime Error):
O = str(input())
E = str(input())

ma = max(len(O), len(E))

for i in range(ma):
    if (i < len(O)):
        print(O[i], end="")
    if (i < len(E)):
        print(E[i], end="")
----
Problem p03773 (python)

Fixed submission:
l = input().split()
A = l[0]
B = l[1]
C = int(A) + int(B)
time = C % 24

print(time)

Buggy submission (verdict: Runtime Error):
def digits(num):
    return len(str(num))

N = int(input())
min_d = digits(N)
for i in list(range(2, N, 1)):
    if (N % i == 0):
        min_d = min(digits(i), min_d)

print(min_d)
Problem p03796 (python)

Fixed submission:
def imp_kai(n):
    ac = 1
    for i in range(n):
        ac *= i + 1
        ac = ac % (1e9 + 7)
    return ac % (1e9 + 7)

n = int(input())
print(int(imp_kai(n)))

Buggy submission (verdict: Runtime Error):
def imp_kai(n):
    ac = 1
    for i in range(n):
        ac *= i + 1
        ac = ac % (1e9 + 7)
    return ac % (1e9 + 7)
-
n = int(input())
print(imp_kai(n))

Buggy submission (verdict: Runtime Error):
def kai(n):
  if (n == 1):
    return 1
  else:
    return n * kai(n-1) % (1e9 + 7)

n = int(input())
print(kai(n))
Problem p03261 (python)

Fixed submission:
n = int(input())
w = []
for i in range(n):
    w.append(input())

def chk_shiri(w):
    for i in range(n - 1):
        if w[i][-1] == w[i + 1][0]:
            continue
        else:
            return False
    return True
    
if len(w) != len(set(w)):
    print('No')
elif chk_shiri(w):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x = input().split('\n')
n = int(x[0])
w = [x[i] for i in range(1, n+1)]

def chk_shiri(w):
    for i in range(n - 1):
        if w[i][-1] == w[i + 1][0]:
            continue
        else:
            return False
    return True
    
if len(w) != len(set(w)):
    print('No')
elif chk_shiri(w):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x = input().split('\n')
n = int(x[0])
w = [x[i] for i in range(1, n+1)]

def chk_shiri(w):
    for i in range(n - 1):
        if w[i][-1] == w[i + 1][0]:
            continue
        else:
            return False
    return True
    
if len(w) != len(set(w)):
    print('No')
elif chk_shiri(w):
    print('Yes')
else:
    print('No')
Problem p03289 (python)

Fixed submission:
S = raw_input()
l=len(S)
if S[:1] == 'A':
	AC = 1
	S = "a"+S[1:]
else:
	AC = 0
if S[2:l-1].count('C')==1:
	AC2 = 1
else:
	AC2 = 0
if S.find('C')>=2:
	S = S[:S.find('C')] + 'c' + S[S.find('C')+1:]
if S.islower():
	AC3 = 1
else:
	AC3 = 0
if AC+AC2+AC3 == 3:
	print 'AC'
else:
	print 'WA'

Buggy submission (verdict: Runtime Error):
S=raw_input();l=len(S);f=S.find('C');A=0
if S[:1]='A':
	A+1
	S="a"+S[1:]
if S[2:l-1].count('C')=1:
	A+1
	S=S[:f]+'c'+S[f+1:]
if S.islower():
	A+1
print('AC'if A=3 else'WA')

Buggy submission (verdict: Runtime Error):
S=raw_input();l=len(S);f=S.find('C');A=0
if S[:1]='A':
	A+1
	S="a"+S[1:]
if S[2:l-1].count('C')=1:
	A+1
	S=S[:f]+'c'+S[f+1:]
if S.islower():
	A+1
print('AC'if A=3 else'WA')
Problem p03351 (python)

Fixed submission:
a,b,c,d = map(int,raw_input().split())
x = max(a,c)-min(a,c)
if d >= x :
	print('Yes')
elif (max(a,b)-min(a,b)) <= d and (max(b,c)-min(b,c)) <= d :
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
x = list(sorted(range(input()), key=int, reverse=True))
for b in x:
	for p in x:
		if b**p <= x[0] and p>=2 and b>=1:
			break
	if b**p <= x[0] and p>=2 and b>=1:
		print(b**p)
		break
Problem p03370 (python)

Fixed submission:
N,X = map(int,raw_input().split())
m = sorted([input() for m in range(N)])
X -= sum(m)
ans = N + X / m[0]
print ans

Buggy submission (verdict: Runtime Error):
N,X = map(int,raw_input().split())
m = sorted([input() for m in range(N)])
X -= sum(m)
print ans = N + X / m[0]
Problem p03262 (python)

Fixed submission:
#! /usr/bin/env python3

import fractions

n, x = map(int, input().split())
a = [abs(int(i) - x) for i in input().split()]

a.sort()

res = 0
for val in a:
    if res == 0:
        res = val
    else:
        res = fractions.gcd(res, val)
        if res == 1:
            break

print(res)

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3

import math

n, x = map(int, input().split())
a = [abs(int(i) - x) for i in input().split()]

a.sort()

res = 0
for val in a:
    if res == 0:
        res = val
    else:
        res = math.gcd(res, val)
        if res == 1:
            break

print(res)
Problem p03407 (python)

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

if a + b >= c:
    print('Yes')
else:
    print('No')

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

red = []
blue = []

for i in range(n):
    red.append(tuple(map(int, input().split())))
for i in range(n):
    blue.append(tuple(map(int, input().split())))

red.sort(key=lambda x:x[1])
red.reverse()

blue.sort(key=lambda x:x[0])

res = 0

for b in range(n):
    for r in range(len(red)):
        if blue[b][0] > red[r][0] and blue[b][1] > red[r][1]:
            res += 1
            del red[r]
            break

print(res)
Problem p03294 (python)

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

# import math
# from functools import reduce
# def lcm_base(x, y):
#     return int((x * y) / math.gcd(x, y))
# def lcm_list(numbers):
#     ans = 0
#     for i in range(1,len(numbers)):
#         if(i == 1):
#             ans = lcm_base(numbers[0], numbers[1])
#         else:
#             ans = lcm_base(ans, numbers[i])
#     return ans
# min_bin= lcm_list(a)
num = 1
for i in a:
    num = num * i
num = num - 1
for i in a:
    ans += num % i
# for i in range(5000000):
#     tmp = 0
#     for j in a:
#         # print(j)
#         tmp += i % j
#     if(tmp > ans):
#         ans = tmp
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
ans = 0
import math
from functools import reduce
def lcm_base(x, y):
    return int((x * y) / math.gcd(x, y))
def lcm_list(numbers):
    ans = 0
    for i in range(1,len(numbers)):
        if(i == 1):
            ans = lcm_base(numbers[0], numbers[1])
        else:
            ans = lcm_base(ans, numbers[i])
    return ans

min_bin= lcm_list(a)

# ans = 0
for i in a:
    ans += (min_bin-1) % i
    # print(tmp)
print(ans)
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2!=0:
  print("Yes")
elif (a*b*3)%2!=0:
  print("Yes")
  
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a*b)%2!==0:
  print("Yes")
elif (a*b*3)%2!==0:
  print("Yes")
  
else:
  print("No)
Problem p03294 (python)

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

m = 1
for a_ in a:
    m *= a_
m -= 1
f = 0
for a_ in a:
    f += m % a_
print(f)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

def lcm(a, b):
  return a*b//gcd(a, b)

def lcm_lst(lst):
  if len(lst) == 1:
    return lst[0]
  return lcm(lst[0], lcm_lst(lst[1:]))


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

m = lcm_lst(a)-1
f = 0
for a_ in a:
    f += m % a_
print(f)
Problem p03262 (python)

Fixed submission:
import fractions
from functools import reduce
import numpy as np
N, X = map(int, input().split())
xlist = list(map(int, input().split()))
xlist.append(X)
xlist.sort()
sa = list(np.array(xlist[1:]) - np.array(xlist[:-1]))
print(reduce(fractions.gcd, sa))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
import numpy as np
N, X = map(int, input().split())
xlist = list(map(int, input().split()))
xlist.append(X)
xlist.sort()
sa = list(np.array(xlist[1:]) - np.array(xlist[:-1]))
print(reduce(math.gcd, sa))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, X = map(int, input().split())
xlist = list(map(int, input().split()))
xlist.append(X)
xlist.sort()
sa = np.array(xlist[1:]) - np.array(xlist[:-1])
print(np.gcd.reduce(sa))
Problem p03848 (python)

Fixed submission:
import numpy as np
N = int(input())
l = list(map(int, input().split()))
l.sort()
L = np.array(l)
flag = False
if N%2==1:
    if np.all(L-np.arange(N)-np.array([0]+[1,0]*(N//2))==0):
        flag = True
    else:
        print(0)
else:
    if np.all(L-np.arange(N)-np.array([1,0]*(N//2))==0):
        flag = True
    else:
        print(0)
if flag:
    a=1
    for i in range(N//2):
        a = (a*2)%(10**9+7)
    print(a)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
l = list(map(int, input().split()))
l.sort()
L = np.array(l)
flag = False
if N%2==1:
    if np.all(L-np.arange(N)-np.array([0]+[1,0]*(N//2))==0):
        flag = True
    else:
        print(0)
else:
    if np.all(L-np.arange(N)-np.array([1,0]*(N/2))==0):
        flag = True
    else:
        print(0)
if flag:
    a=1
    for i in range(N//2):
        a = (a*2)%(10**9+7)
    print(a)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
l = list(map(int, input().split()))
l.sort()
L = np.array(l)
flag = False
if N%2==1:
    if np.all(L-np.arange(N)-np.array([0]+[1,0]*(N//2))==0):
        flag = True
    else:
        print(0)
else:
    if np.all(L-np.arange(N)-np.array([1,0]*(N/2))==0):
        flag = True
    else:print(0)

if flag:
    a=1
    for i in range(N//2):
        a = (a*2)%(10**9+7)
    print(a)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
l = list(map(int, input().split()))
l.sort()
L = np.array(l)
flag = False
if N%2==1:
    if np.all(L-np.arange(N)-np.array([0]+[1,0]*(N//2))==0):
        flag = True
    else:
        print(0)
else:
    if np.all(L-np.arange(N)+np.array([1,0]*(N/2))==0):
        flag = True
    else:print(0)

if flag:
    a=1
    for i in range(N//2):
        a = (a*2)%(10**9+7)
    print(a)
Problem p04045 (python)

Fixed submission:
N, K = map(int, input().split())
Dlist = list(map(int, input().split()))
    
alist = list(set([0,1,2,3,4,5,6,7,8,9]) - set(Dlist))
if sum(x==0 for x in alist) == 0:
    b = min(alist)
else:
    b = min(list(set(alist)-set([0])))
strN = str(N)
c = ""
ans = ""
flag = True
for i in range(len(strN)):
    iN = int(strN[i])
    if sum(x>=iN for x in alist) == 0:
        ans = str(b) + str(min(alist))*len(strN)
        flag = False
        break
    elif sum(x==iN for x in alist) == 0:
        ans = c + str(min([a for a in alist if a>iN])) + str(min(alist))*(len(strN)-1-i)
        flag = False
        break
    else:
        c = c + str(iN)

if flag:
    print(N)
else:
    print(int(ans))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
Dlist = list(map(int, input().split()))
    
alist = list(set([0,1,2,3,4,5,6,7,8,9]) - set(Dlist))
if sum(x==0 for x in alist) == 0:
    b = min(alist)
else:
    b = min(list(set(alist)-set([0])))
strN = str(N)
c = ""
ans = ""
flag = True
for i in range(len(strN)):
    iN = int(strN[i])
    if sum(x>=iN for x in alist) == 0:
        ans = b + str(min(alist))*len(strN)
        flag = False
        break
    elif sum(x==iN for x in alist) == 0:
        ans = c + str(min([a for a in alist if a>iN])) + str(min(alist))*(len(strN)-1-i)
        flag = False
        break
    else:
        c = c + str(iN)

if flag:
    print(N)
else:
    print(int(ans))
Problem p03261 (python)

Fixed submission:
# -*- coding:utf-8 -*-

n = input()
n = int(n)

w = []
for i in range(n):
    _w = input()
    w.append(_w)
ans = "Yes"
for i in range(0,len(w)-1):
    for j in range(i+1,len(w)):
        if w[i] == w[j]:
            ans = "No"
for i in range(0,len(w)-1):
    if w[i][-1] != w[i+1][0] :
        ans ="No"

print(ans)

Buggy submission (verdict: Runtime Error):
9
basic
c
cpp
php
python
nadesico
ocaml
lua
assembly

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

n = input()
n = int(n)

w = []
for i in range(n):
    _w = input()
    w.append(_w)
ans = "YES"
for i in range(0,len(w)-1):
    for j in range(i+1,len(w)):
        if w[i] == w[j]:
            ans = "NO"
for i in range(0,len(w)-1):
    if w[i][-1] != w[i+1][0] :
        ans ="NO"

print(ans)
Problem p03544 (python)

Fixed submission:
n = int(input())
L = [2,1]
if n == 1:
  print(L[1])
else:
  for i in range(2,n+1):
    l = L[i-2] + L[i-1]
    L.append(l)
  print(L[-1])

Buggy submission (verdict: Runtime Error):
n = input()
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print('YES')
else:
  print('NO')
Problem p03699 (python)

Fixed submission:
N=int(input())
List=[int(input()) for i in range(N)]
List.sort()
LIst=[]
total=sum(List)
for i in List:
  if i % 10 != 0:
      LIst.append(i)
      
if total % 10 != 0:
    print(total)
elif LIst == []:
    print(0)
else:
    print(total-LIst[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
List = [int(input()) for i in range(N)]
x = len(List)

while sum(List) % 10 == 0:
  List.remove(min(List))
  if len(List) == 0:
    print(0)
    stop
  
print(sum(List))

Buggy submission (verdict: Runtime Error):
N = int(input())
List = [int(input()) for i in range(N)]
x = len(List)

while sum(List) % 10 == 0:
  List.remove(min(List))
  
print(sum(List))
Problem p03845 (python)

Fixed submission:
N = int(input())
T = list(map(int,input().split()))
M = int(input())
d = [list(map(int,input().split())) for i in range(M)]
t = sum(T)
for i in range(len(d)):
    time = t + d[i][1] - T[d[i][0]-1]
    print(time)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = list(map(int,input().split()))
M = int(input())
d = [list(map(int,input().split())) for i in range(M)]
time = sum(T)
for i in range(len(d)):
    time += d[i][0] - T[d[i][1]-1]
print(time)
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())

answer = 1
for i in range(min(k, len(s))):
    if s[i] != '1':
        answer = s[i]
        break

print(answer)

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

for i in range(n):
    l, r = list(map(int, input().split(' ')))
    cnt += r - l + 1

print(cnt)
Problem p03308 (python)

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

print(max(a) - min(a))

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

print(max(a) - min(a))