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

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

print(eval(a + op + b))

Buggy submission (verdict: Runtime Error):
import copy

n = int(input())
t = list(map(int, input().split()))
sum_t = sum(t)


m = int(input())
for _ in range(m):
    idx, value = map(int, input().split())
    print(sum_t - t[idx - 1] + value)
Problem p03854 (python)

Fixed submission:
S = input()

s = S.replace("eraser", "").replace("erase", "").replace("dreamer", "").replace("dream", "")
if len(s) == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import re

S = input()

s = re.sub(r"(dreamer)|(eraser)", "", s)
s = re.sub(r"(dream)|(erase)", "", S)

if len(s) == 0:
    print("YES")
else:
    print("NO")
Problem p04030 (python)

Fixed submission:
s = input()
ans = []

for i in s:
    if i in ["0", "1"]:
        ans.append(i)
    else:
        if len(ans):
            ans.pop()

print("".join(ans))

Buggy submission (verdict: Runtime Error):
s = input()
ans = []

for i, j in enumerate(s):
    if j in ["0", "1"]:
        ans.append(j)
    else:
        if len(ans):
            del ans[i - 1]

print("".join(ans))
Problem p02657 (python)

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

print(a * b)

Buggy submission (verdict: Runtime Error):
N = int(input())
Ai = list(map(int, input().split()))
     
result = 1
     
if 0 in Ai:
	result= '0'  
else:
  for i in range(N):
      result *= Ai[i]
      if result > 10**18:
        result = '-1'
     
print(result)

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

result = 1

if 0 in Ai:
	result= '0'  
else:
  for i in range(N):
      result *= Ai[i]

  	if result > 10**18:
    	result = '-1'

print(result)

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

result = 1
for i in Ai:
	result *= i

if result > 10**18:
  result = '-1'

print(result)

Buggy submission (verdict: Runtime Error):
S1, S2 = input().strip().split()
print(S1*S2)
Problem p02658 (python)

Fixed submission:
import sys
n = int(input())
a = list(map(int,input().split()))
if 0 in a:
    print(0)
    sys.exit()
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
Ai = list(map(int, input().split()))
     
result = 1
     
if 0 in Ai:
  result= '0'  
else:
  for i in range(N):
    result *= Ai[i]
      if result > 10**18:
        result = '-1'
     
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
Ai = list(map(int, input().split()))
     
result = 1
     
if 0 in Ai:
	result= '0'  
else:
  for i in range(N):
      result *= Ai[i]
      if result > 10**18:
        result = '-1'
     
print(result)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
x = [chr(i) for i in range(97, 97+26)]
list = []
for i in range(26):
    list.append(S+x[i])
if T in list:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
city_list = list(map(int, input().split()))
th_list = []
n = 0
count = 0
for i in range(N):
    count += 1
    th_list.append(n)
#   print(n)
    n = city_list[n] - 1
''' if n in th_list:
        #繰り返されている個数を出す
        num = len(th_list)-th_list.index(n)
        break'''
 
#print(city_list, th_list)
count = -1
for i in range(N):
    if th_list.count(th_list[i]) > 1:
        break
list = [x for x, l in enumerate(th_list) if l == th_list[i]]
#print(list)
#print(list[0])
#print(th_list)
if K > N:
    print(th_list[(K-list[0])%(list[1]-list[0])+list[0]]+1)
else:
    print(th_list[K]+1)
Problem p02741 (python)

Fixed submission:
x = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
N = int(input())
print(x[N-1])

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

if a==1 or b == 1:
  print("0")
else if a*b%2==0:
    print(int(a*b/2))
else:
    print(int((a*b-1)/2+1))
Problem p02801 (python)

Fixed submission:
x = input()
list = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

for i in range(26):
    if list[i] == x:
        print(list[i + 1])

Buggy submission (verdict: Runtime Error):
x=input()
list=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]

for i in range(26):
  if list[i] = x:
    print(list[i+i])
Problem p02812 (python)

Fixed submission:
N = int(input())
word = list(input())
count = 0
for i in range(N - 2):
    if word[i]=="A" and word[i+1]=="B" and word[i+2]=="C":
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
word = list(input())
count = 0
for i in range(N-2):
  if word[i]=A and word[i+1]=B and word[i+2]=C:
    count += 1
    
print(count)
Problem p03323 (python)

Fixed submission:
a, b = map(int, input().split())
if a <= 8 and b <= 8:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
a, b = map(input().split())
if a < 8 and b < 8:
  print("Yay!")
else:
  print(":(")
Problem p03324 (python)

Fixed submission:
# numが100で何回割れるか
def getDevide100Count(num: int):
    n = 0
    while num % 100 == 0:
        num = num / 100 
        n += 1
    return n


d, n = map(int, input().split())
count = 0
i = 0
while count != n:
    i += 1
    if getDevide100Count(i) == d:
        count += 1

print(i)

Buggy submission (verdict: Runtime Error):
d, n = map(int, input().split())
count = 0
for i in range(0, 10000 * 100 + 1):
  if i % (pow(100 , d)):
    count += 1
    if count == n:
      print(i)
      return
Problem p03325 (python)

Fixed submission:
def num_divide_two(num: int):
    return int(format(num, 'b')[::-1].find("1"))

N = int(input())
print(sum(map(num_divide_two, map(int, input().split()))))

Buggy submission (verdict: Runtime Error):
def num_divide_two(num: int):
    return int(format(num, 'b')[::-1].find("1"))

N = int(input())
print(sum(map(num_divide_two, map(int, input().split())))
Problem p02612 (python)

Fixed submission:
n = int(input())
n = 1000 - n
while n < 0:
    n += 1000
print(n)

Buggy submission (verdict: Runtime Error):
n = input()
n = 1000 - n
while n < 0:
    n += 1000
print(n)
Problem p02646 (python)

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

if t * (v - w) >= abs(a - b):
  print('YES')
else:
  print('NO')

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

if abs(t * (w - v)) >= abs(b - a):
  print('YES')
else:
  print('NO')
Problem p02641 (python)

Fixed submission:
def solve():
    x, n = map(int, input().split())

    if not n:
        print(x)
        return

    ps = list(map(int, input().split()))
    flgs = [1] * 102

    for p in ps:
        flgs[p] = 0

    ansr = 101
    ansl = 101
    index = x
    while 1:
        if flgs[index] == 1:
            ansr = index
            break
        else:
            index += 1

    index = x
    while 1:
        if flgs[index] == 1:
            ansl = index
            break
        else:
            index -= 1

    if abs(ansr - x) >= abs(ansl - x):
        print(ansl)
    else:
        print(ansr)


solve()

Buggy submission (verdict: Runtime Error):
def solve():
    x, n = map(int, input().split())
    if not n:
        print(x)
        return

    ps = list(map(int, input().split()))
    flgs = [1] * 101

    for p in ps:
        flgs[p] = 0

    ansr = 101
    ansl = 101
    index = x
    while 1:
        if flgs[index] == 1:
            ansr = index
            break
        else:
            index += 1

    index = x
    while 1:
        if flgs[index] == 1:
            ansl = index
            break
        else:
            index -= 1

    if abs(ansr - x) >= abs(ansl - x):
        print(ansl)
    else:
        print(ansr)


solve()
Problem p02658 (python)

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

ans = 1

for i in A_list:
    if i == 0:
        ans = 0

if ans != 0:
    for i in A_list:
        ans = ans * i
        if ans > 10 ** 18:
            ans = -1
            break

print(ans)

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

ans = 1

for i in A_list:
    if i == 0:
        print(0)
        exit(1)

for i in A_list:
    ans = ans * i
    if ans > 10 ** 18:
        ans = -1
        break

print(ans)
Problem p02612 (python)

Fixed submission:
N = int(input())
if N%1000 == 0:
  print(0)
else:
  print(1000 - N%1000)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = ['-1' for _ in range(N+1)]
C = {}
C['AC'] = 0; C['WA'] = 0; C['TLE'] = 0; C['RE'] = 0
for i in range(N):
  S[i+1] = input()
  C[S[i+1]] += 1
for case in ['AC', 'WA', 'TLE', 'RE']:
  print('{} x {}'.format(case,str(C[case])))
Problem p02613 (python)

Fixed submission:
N = int(input())
S = ['-1' for _ in range(N+1)]
cases = ['AC', 'WA', 'TLE', 'RE']
C = dict(zip(cases, [0]*len(cases)))
for i in range(N):
  S[i+1] = input()
  C[S[i+1]] += 1
for case in cases:
  print('{} x {}'.format(case,str(C[case])))

Buggy submission (verdict: Runtime Error):
    N = int(input())
    S = ['-1' for _ in range(N+1)]
    C = {}
    C['AC'] = 0; C['WA'] = 0; C['TLE'] = 0; C['RE'] = 0
    for i in range(N):
        S[i+1] = input()
        C[S[i+1]] += 1
    for case in ['AC', 'WA', 'TLE', 'RE']:
        print('{} x {}'.format(case,str(C[case])))
Problem p02639 (python)

Fixed submission:
x = list(map(int, input().split()))
count = 1
for i in x:
  if i == 0:
    print(count)
    break
  count += 1

Buggy submission (verdict: Runtime Error):
	x = list(map(int, input().split()))
    count = 1
    for i in x:
        if i == 0:
            print(count)
            break
        count += 1
Problem p03294 (python)

Fixed submission:
import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // math.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

Buggy submission (verdict: Runtime Error):
    N = int(input())
    a = list(map(int, input().split()))
    l = a[0]
    for i in range(1,N):
        l = l * a[i] // fractions.gcd(l, a[i])
    # print(l)

    m = l-1

    # f
    fm = 0
    for i in range(N):
        fm += m % a[i]
    print(fm)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
# print(l)

m = l-1

# function
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)
Problem p02613 (python)

Fixed submission:
import sys
N = int(input())
array = [ input() for a in range(N) ]
base = ['AC','WA','TLE','RE']

for I in base:
    print(I+' x '+str(array.count(I)))

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
base = ['AC','WA','TLE','RE']
array = [ input() for a in range(N) if input() in base]

if not ( 1 <= N <= 10**5 ): sys.exit()

for I in base:
    print(I+' x '+str(array.count(I)))

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
array = [ input() for a in range(6) ]
base = ['AC','WA','TLE','RE']

for I in base:
    print(I+' x '+str(array.count(I)))
Problem p02640 (python)

Fixed submission:
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
  b = X - a
  if 2 * a + 4 * b == Y:
    ans = 'Yes'
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
 b = X - a
 if 2 * a + 4 * b == Y:
 ans = 'Yes'
 print(ans)

Buggy submission (verdict: Runtime Error):
import sys

X, Y = map(int, input().split())
ans = 'No'
if X[0] > 100 or X[1] > 100:
  print(ans)
  sys.exit()
if X[1] > X[0]*4 or X[1] < X[0]*2:
  print(ans)
  sys.exit()
if X[1] % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
 b = X - a
 if 2 * a + 4 * b == Y:
 ans = 'Yes'
 print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
 b = X - a
 if 2 * a + 4 * b == Y:
 ans = 'Yes'
 print(ans)

Buggy submission (verdict: Runtime Error):
X = list(map(int, input().split()))
if X[0] > 100 or X[1] > 100:
  no_print
if X[1] > X[0]*4 or X[1] < X[0]*2:
  no_print
if X[1] % 2 == 1:
  no_print

number_check
  
def no_print():
  print(No)
  exit
    for I in list(range(1,100,1))

def number_check():
  turtle = X[0]
  crane = 0
  for (int i==0; i <= X[0]: i++):
    result = turtle * 4 + crane * 2 
    if result > X[1]:
      crane += 1
      turtle -= 1
    if result == X[1]:
      print(Yes)
      exit
    if result < X[1]:
      turtle += 1
      crane -= 1
Problem p02641 (python)

Fixed submission:
import sys

X,N = map(int,input().split())
P = list(map(int,input().split()))
if X < 1 or 100 < X:
    sys.exit()
if N < 0 or 100 < N:
    sys.exit()
if N == 0:
    print(X)
    sys.exit()

P_number = len(P)
if P_number < 1 or 100 < P_number:
    sys.exit()

res1 = 100
res2 = 100
res0 = 0
i = 0
j = 0
while i <= N:
    if (X - i) not in P:
        res1 = (X - i)
        break
    i += 1
while j <= N:
    if (X + j) not in P:
        res2 = (X + j)
        break
    j += 1
if i > j:
    res0 = res2
elif j > i:
    res0 = res1
elif i == j:
    res0 = res1
print(res0)

Buggy submission (verdict: Runtime Error):
import sys

X,N = map(int,input().split())
P = list(map(int,input().split()))
if X < 1 or 100 < X:
    sys.exit()
if N < 0 or 100 < N:
    sys.exit()
if N == 0:
    print(X)
    sys.exit()

P_number = len(P)
if P_number < 1 or 100 < P_number:
    sys.exit()

res1 = 100
res2 = 100
res0 = 0
i = 0
while i < N:
    if !((X - i) in P):
        res1 = (X - i)
    i += 1
while j < N:
    if !((X + j) in P):
        res2 = (X + j)
    j += 1
if res2 > res1:
    res0 = res1
else if res1 > res2:
    res0 = res2
else if res2 == res1:
    res0 = res1
print(res0)

Buggy submission (verdict: Runtime Error):
import sys

X,N = map(int,input().split())
P = list(map(int,input().split()))
if X < 1 or 100 < X:
    sys.exit()
if N < 0 or 100 < N:
    sys.exit()
P_number = count(P)
if P_number < 1 or 100 < P_number:
    sys.exit()

res = 100
count = 0
while i < N:
    if res > abs(X - P[i]):
        res = X - P[i] 
print(res)
Problem p02657 (python)

Fixed submission:
import sys
A,B = map(int,input().split())
if not ( 1 <= A <= 100 and 1 <= B <= 100 ): sys.exit()

print(A*B)

Buggy submission (verdict: Runtime Error):
import sys
A,B = map(int,input())
if not ( 1 <= A <= 100 and 1 <= B <= 100 ): sys.exit()

print(A*B)
Problem p02848 (python)

Fixed submission:
import sys
import string
N = int(input())
S = input()
s = list(S)
array = string.ascii_uppercase

if not ( 0 <= N <= 26 ): sys.exit()
if not ( 1 <= len(s) <= 10**4 ): sys.exit()
if not S.isupper(): sys.exit()

for I in s:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 26],end='')

Buggy submission (verdict: Runtime Error):
import sys
import string
import itertools
N = int(input())
S = list(input())
array = string.ascii_uppercase

for I in S:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 25],end='')
print('\n')

Buggy submission (verdict: Runtime Error):
import sys
import string
import itertools
N = int(input())
S = list(input())
array = string.ascii_uppercase

for I in S:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 25],end='')
Problem p02910 (python)

Fixed submission:
import sys
S = list(input())
S_odd = S[::2]
S_even = S[1::2]
easy_odd = ['R','U','D']
easy_even = ['L','U','D']

print('Yes') if set(S_odd).issubset(easy_odd) and set(S_even).issubset(easy_even) else print('No')

Buggy submission (verdict: Runtime Error):
import sys
S = list(input())
S_odd = S[::2]
S_even = S[1::2]
easy_odd = ['R','U','D']
easy_even = ['L','U','D']

print('Yes') if set(S_odd).issubset(easy_odd) and set(S_even).issubset(easy_even) else 
    print('No'
Problem p02982 (python)

Fixed submission:
import sys
import itertools
N,D = map(int,input().split())
array = [ list(map(int,input().split())) for x in range(N) ]

if not ( 2 <= N <= 10 and 1 <= D <= 10 ): sys.exit()
for I in array:
    if not ( -20 <= min(I) and max(I) <= 20 ): sys.exit()

count = 0
for I in list(itertools.combinations(array,2)):
    tmp_distance = 0
    for J in range(D):
        tmp_distance += abs(I[0][J] - I[1][J]) ** 2
    distance = tmp_distance ** 0.5 
    if distance.is_integer(): count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import sys
import itertoolsy
N,D = map(int,input().split())
array = [ list(map(int,input().split())) for x in range(N) ]

if not ( 2 <= N <= 10 and 1 <= D <= 10 ): sys.exit()
for I in array:
    if not ( -20 <= min(I) and max(I) <= 20 ): sys.exit()

count = 0
for I in list(itertools.combinations(array,2)):
    tmp_distance = 0
    for J in range(D):
        tmp_distance += abs(I[0][J] - I[1][J]) ** 2
    distance = tmp_distance ** 0.5 
    if distance.is_integer(): count += 1

print(count)
Problem p03086 (python)

Fixed submission:
import sys
import re
S = input()
if not ( 1 <= len(S) <= 10 ): sys.exit()
if not S.isupper: sys.exit()

result = 0
max = max(re.findall('[A|T|G|C]+', S),key=len) if re.findall('[A|T|G|C]+', S) else ''
if len(max) > 0:result = len(max)
print(result)

Buggy submission (verdict: Runtime Error):
import sys
import re
S = input()
if not ( 1 <= len(S) <= 10 ): sys.exit()
if not S.isupper: sys.exit()

max = max(re.findall('[A|T|G|C]+', S)) if re.findall('[A|T|G|C]+', S) else 0
if max > 0:max
print(max)

Buggy submission (verdict: Runtime Error):
import sys
import re
S = input()
if not ( 1 <= len(S) <= 10 ): sys.exit()
if not S.isupper: sys.exit()

print(len(max(re.findall('[A|T|G|C]+', S))))
Problem p03251 (python)

Fixed submission:
import sys
N,M,X,Y = map(int,input().split())
array_x = list(map(int,input().split()))
array_y = list(map(int,input().split()))

if not ( 1 <= N <= 100 and 1 <= M <= 100 ): sys.exit()
if not ( -100 <= X <= 100 and -100 <= Y <= 100 ): sys.exit()
for I in array_x:
    if not ( -100 <= I <= 100 and array_x.count(I) == 1 and I != X): sys.exit()
for J in array_y:
    if not ( -100 <= J <= 100 and array_y.count(J) == 1 and J != Y): sys.exit()

for I in range(X+1,Y+1):
    if I > max(array_x) and I <= min(array_y):
        print('No War')
        sys.exit()
print('War')

Buggy submission (verdict: Runtime Error):
import sys
N,M,X,Y = map(int,input().split())
array_x = list(map(int,input().split()))
array_y = list(map(int,input().split()))

if not ( 1 <= N <= 100 and 1 <= M <= 100 ): sys.exit()
if not ( -100 <= X <= 100 and -100 <= Y <= 100 ): sys.exit()
for I in array_x:
    if not ( -100 <= I <= 100 and array_x.count(I) == 1 and I != X): sys.exit()
for J in array_y:
    if not ( -100 <= J <= 100 and array_y.count(J) == 1 and J != Y): sys.exit()

if min(array_y) - max(array_x) >= 1:
    for K in range(max(array_x),min(array_y)+1):
        if X < K <= Y and max(array_x) < K and min(array_y) >= K:
            print('No War')
            sys.exit()
if min(array_x) - max(array_y) >= 1:
    for L in range(max(array_y),min(array_x)+1):
        if X < K <= Y and max(array_y) < K and min(array_x) >= K:
            print('No War')
            sys.exit()
print('War')

Buggy submission (verdict: Runtime Error):
import sys
N,M,X,Y = map(int,input().split())
array_x = list(map(int,input().split()))
array_y = list(map(int,input().split()))

if not ( 1 <= N <= 100 and 1 <= M <= 100 ): sys.exit()
if not ( -100 <= X <= 100 and -100 <= Y <= 100 ): sys.exit()
for I in array_x:
    if not ( -100 <= I <= 100 and array_x.count(I) == 1 and I != X): sys.exit()
for J in array_y:
    if not ( -100 <= J <= 100 and array_y.count(J) == 1 and J != Y): sys.exit()

if min(array_y) - max(array_x) >= 1:
    for K in range(max(array_x),min(array_y)+1):
        if X < K <= Y and max(array_x) < K and min(array_y) >= K:
            print('No War')
            sys.exit()
if min(array_x) - max(array_y) >= 1:
    for L in range(max(array_y),min(array_x)+1):
        if X < K <= Y and max(array_x) < K and min(array_y) >= K:
            print('No War')
            sys.exit()
print('War')
Problem p03385 (python)

Fixed submission:
import sys
S = list(input())
if len(S) != 3:
    sys.exit


if S.count('a') == 1 and S.count('b') == 1 and S.count('c') == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
A,B,K = map(int,input().split())
if not (1 <= A <= B <= 10 ** 9):
    sys.exit()
if not (1 <= K <= 100):
    sys.exit()

result = list(range(A,B+1))[0:K] + list(range(A,B+1))[-K:]
result = list(set(result))
result.sort()
for I in result:
    print(I)
Problem p03543 (python)

Fixed submission:
import sys
N = int(input())
N2 = list(map(int,str(N)))
if not (1000 <= N <= 9999):
    sys.exit()

if N2[0] == N2[1] == N2[2] or N2[1] == N2[2] == N2[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
N2 = list(map(int,str(N)))
if not (1000 <= N <= 9999):
    sys.exit()

if N2[0] == N2[1] == N2[2] or N2[1] == N2[2] == N[3]:
    print("Yes")
else:
    print("No")
Problem p03816 (python)

Fixed submission:
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()

print(len(list(set_array))) if len(list(set_array)) % 2 == 1 else print(len(list(set_array)) - 1)

Buggy submission (verdict: Runtime Error):
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()
if len(array) == len(list(set_array)): print(0);sys.exit()

print(len(list(set_array))) if len(list(set_array)) % 2 == 1 else print(len(list(set_array) - 1))

Buggy submission (verdict: Runtime Error):
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()
if len(array) == len(list(set_array)): print(0);sys.exit()

print(len(list(set_array))) if len(list(set_array) % 2 == 1 else print(len(list(set_array) - 1)
Problem p02717 (python)

Fixed submission:
a,b,c = input().split()
print(c+' '+a+' '+b)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
mod=1/(4*m)
ch=sum(a)*mod
r=0
for i in range(n):
  if a[i]>=ch:
    r+=1
  if r==m:
    print('Yes')
    break
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
mod=1/(4*m)
ch=sum(a)*mod
r=0
for i in range(n):
  if a[i]>=ch:
    r+=1
  if r==m:
    print('Yes')
    break
else:
  print('No')

Buggy submission (verdict: Runtime Error):
X,Y,Z= int(input())
print(Z,X,Y)
Problem p03316 (python)

Fixed submission:
n = int(raw_input())
sum = 0
tmp = n
 
while tmp > 0:
    sum += tmp % 10
    tmp /= 10
 
if n % sum == 0:
    print "Yes"
else:
    print "No"

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
sum = 0
tmp = n
 
while tmp > 0:
    sum += tmp % 10
    tmp /= 10
 
if n % sum == 0:
    print "Yes"
else:
    print "No"
Problem p02612 (python)

Fixed submission:
x = int(input())
if x%1000 == 0:
  y = 0
else:
  y = 1000 - (x%1000)
    
print(y)

Buggy submission (verdict: Runtime Error):
def main():
	x = int(input())
    y = x%1000
    return y

if __name__ =="__main__":
  main()