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

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
pool = []
[pool.append((a, 1)) for a in A]
for _ in range(M):
  b, c = (map(int, input().split()))
  pool.append((c, b))
pool.sort(reverse=True, key=lambda x:x[0])

while N>0:
  for p in pool:
    if p[1] >= N:
      ans += p[0]*N
      N = 0
    if p[1] < N:
      ans += p[0]*p[1]
      N -= p[1]

print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
Z = []
for _ in range(M):
  B, C = map(int, input().split())
  [Z.append(C) for _ in range(B)]
Z.sort(reverse=True)
for i in range(N):
  if Z[i] > A[i]:
      A[i] = Z[i]
  else:
    break
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
ope = []
for _ in range(M):
  ope.append(list(map(int, input().split())))
for m in ope:
  for i in range(m[0]):
    if m[1] > A[i]:
      A[i] = m[1]
	A.sort()
print(sum(A))
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower+s[k:])
Problem p03053 (python)

Fixed submission:
import numpy as np
from scipy import ndimage

h, w = map(int, input().split())
map = [input() for _ in range(h)]
mapB = np.zeros((h, w))
for i, ii in enumerate(map):
  for j, jj in enumerate(ii):
    if jj == '.':
      mapB[i, j] = 1
dist = ndimage.distance_transform_cdt(mapB, metric="taxicab")
print(dist.max())

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

h, w = map(int, input().split())
map = [input() for _ in range(h)]
mapB = np.zeros((h, w))
for i, ii in enumerate(map):
  for j, jj in enumerate(ii):
    if jj == '#':
      mapB[i, j] = 1
map = copy.deepcopy(mapB)
      
count = 0
done = False

while not done:
  count +=1
  for i in range(w):
    for j in range(h):
      if map[i, j] >= 1:
          mapB[max(0, i-1), j] = 1 
          mapB[i, max(0, j-1)] = 1 
          mapB[min(h-1, i+1), j] = 1 
          mapB[i, min(w-1, j+1)] = 1 

  if mapB.all():
    done = True
    break
  
  map = map + mapB
  
print(count)
Problem p03272 (python)

Fixed submission:
n,i = map(int,input().split(" "))
print(n+1-i)

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())
print(int(N+1-i))

Buggy submission (verdict: Runtime Error):
N = int(input())
i = int(input())
print(N+1-i)
Problem p03137 (python)

Fixed submission:
fl = input()
sl = input()

koma_num, pos_num = [int (x) for x in fl.split(" ")]
poses = [int(x) for x in sl.split(" ")]
poses.sort()

if koma_num >= pos_num:
    print("0")
    exit()

dists = []
total = 0
for n in range(pos_num-1):
    dist = poses[n+1] - poses[n]
    dists.append(dist)
    total += dist

dists.sort()
dists.reverse()

if(len(dists) == 0):
    print("0")
    exit()

for n in range(koma_num-1):
    total -= dists[n]

print(total)

Buggy submission (verdict: Runtime Error):
fl = input()
sl = input()

koma_num, pos_num = [int (x) for x in fl.split(" ")]
poses = [int(x) for x in sl.split(" ")]
poses.sort()

if koma_num >= pos_num:
    print("0")

dists = []
total = 0
for n in range(pos_num-1):
    dist = poses[n+1] - poses[n]
    dists.append(dist)
    total += dist

dists.sort()
dists.reverse()

for n in range(koma_num-1):
    total -= dists[n]

print(total)

Buggy submission (verdict: Runtime Error):
fl = input()
sl = input()

koma_num, pos_num = [int (x) for x in fl.split(" ")]
poses = [int(x) for x in sl.split(" ")]
poses.sort()

dists = []
total = 0
for n in range(pos_num-1):
    dist = poses[n+1] - poses[n]
    dists.append(dist)
    total += dist

dists.sort()
dists.reverse()

for n in range(koma_num-1):
    total -= dists[n]

print(total)

Buggy submission (verdict: Runtime Error):
fl = input()
sl = input()

koma_num, pos_num = [int (x) for x in fl.split(" ")]
poses = [int(x) for x in sl.split(" ")]
poses.sort()

dists = []
total = 0
for n in range(pos_num-1):
    dists.append(abs(poses[n+1] - poses[n]))
    total += poses[n+1] - poses[n]

dists.sort()
dists.reverse()

for n in range(koma_num-1):
    total -= dists[n]

print(total)
Problem p03631 (python)

Fixed submission:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a = str(input())
if a[0] == a[-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a = str(input())
if a[0]=a[-1]:
    print("Yes")
else:
    print("No")
Problem p03135 (python)

Fixed submission:
t,x = [int(i) for i in input().split()]
print(t/x)

Buggy submission (verdict: Runtime Error):
8 3
Problem p03041 (python)

Fixed submission:
N, K = map(int, input().split())
S = list(input())
 
S[K - 1] = S[K - 1].lower()
 
print(''.join(S))

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

S[K - 1] = S[K - 1].lower()

print(''.json(S))

Buggy submission (verdict: Runtime Error):
# 文字列のリストとして受け取りので、高階関数mapでint関数を各要素に適用
N, K = map(int, input().split())
# 入力される文字列を、文字のリストに変換する
S = list(input())

S[K - 1] = S[K - 1].lower()

print(''.json(S))
Problem p03041 (python)

Fixed submission:

n, k = map(int, input().split())
#k = input()
s = input()

word = s[k-1].lower()

b = s[:k-1]

a = s[k:]

new_s = b + word + a

print(new_s)

Buggy submission (verdict: Runtime Error):

n, k = input().split()
#k = input()
s = input()

word = s[k-1].lower()

b = s[:k-1]

a = s[k:]

new_s = b + word + a

print(new_s)

Buggy submission (verdict: Runtime Error):

n = input()
k = input()
s = input()

word = s[k-1].lower()

b = s[:k-1]

a = s[k:]

new_s = b + word + a

print(new_s)

Buggy submission (verdict: Runtime Error):

n = input()
k = input()
s = input()

word = s[k-1].lower()

b = s[:k-1]

a = s[k:]

new_s = b + word + a

print(new_s)
Problem p03072 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
out = 0
for i in range(len(a)):
  flg = 1
  if i > 0 :
    for j in range(i):
      if not (a[j] <= a[i]):
        flg = 0
  if flg == 1:
    out += 1
print(out)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
out = 0
for i in range(len(a)):
  if i > 0 :
  	for j in range(i):
  		if not (a[j] <= a[i]):
      		break
  out += 1
print(out)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
out = 0
for i in range(len(a)):
  if i > 0 :
  	for j in range(i):
  		if not (a[j] <= a[i]):
      		continue
  out += 1
print(out)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
out = 0
for i in range(len(a)):
  if i > 0 :
  	for j in range(i):
  		if not (a[j] =< a[i]):
      		continue
  out += 1
print(out)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
out = 0
for i in range(len(a)):
  if max([i for i, x in enumerate(l_dup) if x == max(a[:i+1])]) == i:
    out += 1
print(out)
Problem p03242 (python)

Fixed submission:
s = input()
cha = list(s)
answer = []
for hoge in cha:
  if hoge == '1':
    answer.append('9')
  else:
    answer.append('1')
print(''.join(answer))

Buggy submission (verdict: Runtime Error):
s = input()
cha = list(s)
answer = []
for hoge in int_cha:
  if hoge == '1':
    answer.append('9')
  else:
    answer.append('1')
print(''.join(answer))

Buggy submission (verdict: Runtime Error):
s = input()
cha = list()
answer = []
for hoge in int_cha:
  if hoge == '1':
    answer.append('9')
  else:
    answer.append('1')
print(''.join(answer))
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1] + s[k-1].lower() + s[k:])

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

print(s[:k-1] + lower(s[k-1]) + s[k:])
Problem p03072 (python)

Fixed submission:
c=int(input())
a=list(map(int,input().split()))
b=0
count=0
for i in range(0,c):
    if a[i]>=b:
        count=count+1
        b=a[i]
print(count)

Buggy submission (verdict: Runtime Error):
c=int(input())
a=list(map(int,input().split()))
b=0
count=0
for i in a:
    if a[i]>=b:
        count=count+1
        b=a[i]
print(count)

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
b=0
count=0
for i in range(1,a[0]+1):
    if a[i]>=b:
        count=count+1
        b=a[i]
print(count)
Problem p03073 (python)

Fixed submission:
S = input()
sumi = 0
sumii = 0

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i:i+1] == "1":
      sumi += 1
  if (i % 2) == 1:
    if S[i:i+1] == "0":
      sumi += 1

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i:i+1] == "0":
      sumii += 1
  if (i % 2) == 1:
    if S[i:i+1] == "1":
      sumii += 1
        
if sumi > sumii:
  print(sumii)
else:
  print(sumi)

Buggy submission (verdict: Runtime Error):
S = input()
sum01 = 0
sum10 = 0

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i:i+1] == 1:
      sum01 += 1
  if (i % 2) == 1:
    if S[i:i+1] == 0:
      sum01 += 1

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i+:i+1] == 0:
      sum10 += 1
  if (i % 2) == 1:
    if S[i:i+1] == 1:
      sum10 += 1
        
if sum01 > sum10:
  print(sum10)
else:
  print(sum01)

Buggy submission (verdict: Runtime Error):
S = input()
sum01 = 0
sum10 = 0

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i:i+1] == '1':
      sum01 += 1
  if (i % 2) == 1:
    if S[i:i+1] == '0':
      sum01 += 1

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i+:i+1] == '0':
      sum10 += 1
  if (i % 2) == 1:
    if S[i:i+1] == '1':
      sum10 += 1
        
if sum01 > sum10:
  print(sum10)
else:
  print(sum01)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e - a) <= k:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
import heapq as hq

X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

pri = []
data = []
hq.heapify(pri)

A.sort()
B.sort()
C.sort()
A.reverse()
B.reverse()
C.reverse()

hq.heappush(pri, [-A[0]-B[0]-C[0],0,0,0])
data.append([0,0,0])

for i in range(K):
    s = pri[0][1]
    t = pri[0][2]
    u = pri[0][3]
    if s+1 <= X-1:
        if [s + 1, t, u] not in data:
            data.append([s+1, t, u])
            hq.heappush(pri, [-A[s+1]-B[t]-C[u],s+1,t,u])
    if t+1 <= Y-1:
        if [s, t+1, u] not in data:
            data.append([s, t+1, u])
            hq.heappush(pri, [-A[s]-B[t+1]-C[u],s,t+1,u])
    if u+1 <= Z-1:
        if [s, t, u+1] not in data:
            data.append([s, t, u+1])
            hq.heappush(pri, [-A[s]-B[t]-C[u+1],s,t,u+1])
    print(hq.heappop(pri)[0] * -1)

Buggy submission (verdict: Runtime Error):
X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort()
B.sort()
C.sort()
A.reverse()
B.reverse()
C.reverse()

data = []

for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if i * j * k <= K:
                data.append(A[i] + B[j] + C[k])
                
data.sort()
data.reverse()
for i in range(K):
    print(data[i])

Buggy submission (verdict: Runtime Error):
a = [int(i) for i in input().split()]

if a[4] - a[0] <= a[5]:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
N = 6 #the number of the input data
a = [[int(i) for i in input().split()] for j in range(N)]

if a[N-2] - a[0] <= k:
    print("Yay!")
else:
    print(":(")
Problem p03077 (python)

Fixed submission:
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

list_t = [A,B,C,D,E]
lowest = list_t[0]

for i in range(len(list_t)):
    if lowest >= list_t[i]:
        lowest = list_t[i]
    
    
if (N % lowest) != 0:
    print(N // lowest + 5)
else:
    print(N // lowest + 4)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

list_t = [A,B,C,D,E]
lowest = list_t[0]

for i in range(len(list_t)):
    if lowest >= list_t[i]:
        lowest = list_t[i]
    
a = N // lowest
print(a + 5
Problem p03221 (python)

Fixed submission:
N,M = map(int, input().split())
piys = [[] for _ in range(N)] 
for i in range(M):
    p, y = map(int, input().split())
    piys[p-1].append((y,i))
    
ans = [None]*M
for p,iys in enumerate(piys):
    iys.sort()
    for k,(y,i) in enumerate(iys):
        ans[i] = "%06d%06d" % (p+1,k+1)
 
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
piys = [[] for _ in range(M)] 
for i in range(M):
    p, y = map(int, input().split())
    piys[p-1].append((y,i))
    
ans = [None]*M
for p,iys in enumerate(piys):
    iys.sort()
    for k,(y,i) in enumerate(iys):
        ans[i] = "%06d%06d" % (p+1,k+1)

for i in ans:
    print(i)

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

N,M = map(int, input().split())
piys = [[] for _ in range(M)] 
for i in range(M):
    p, y = map(int, input().split())
    piys[p-1].append((y,i))
    
ans = [None]*M
for p,iys in enumerate(piys):
    iys.sort()
    for k,(y,i) in enumerate(iys):
        ans[i] = "%06d%06d" % (p+1,k+1)

for i in ans:
    print(i)

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

N,M = map(int, input().split())
piys = [[] for _ in range(M)] 
for i in range(M):
    p, y = map(int, input().split())
    piys[p-1].append((y,i))
    
ans = [None]*M
for p,iys in enumerate(piys):
    iys.sort(key=lambda x:x[0])
    for k,(y,i) in enumerate(iys):
        ans[i] = "%06d%06d" % (p+1,k+1)

for i in ans:
    print(i)
Problem p03072 (python)

Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
 
maxx = 0
count = 0
for n in nums:
    if n>=maxx:
        maxx = n
        count += 1
 
print(count)

Buggy submission (verdict: Runtime Error):

N = int(input())
nums = list(map(int, gen.__next__().split()))

maxx = 0
count = 0
for n in nums:
    if n>=maxx:
        maxx = n
        count += 1

print(count)
Problem p03073 (python)

Fixed submission:
S = list(input())
 
count = 0
s1 = S[:]
for i in range(1, len(S)):
    if s1[i - 1] == s1[i]:
        s1[i] = '0' if s1[i-1] == '1' else '1'
        count += 1
 
count2 = 0
s2 = S[:]
for i in reversed(range(len(S)-1)):
    if s2[i] == s2[i +1]:
        s2[i] = '0' if s2[i+1] == '1' else '1'
        count2 += 1
 
print(min(count, count2))

Buggy submission (verdict: Runtime Error):
gen = get_input()

S = list(input())

count = 0
s1 = S[:]
for i in range(1, len(S)):
    if s1[i - 1] == s1[i]:
        s1[i] = '0' if s1[i-1] == '1' else '1'
        count += 1

count2 = 0
s2 = S[:]
for i in reversed(range(len(S)-1)):
    if s2[i] == s2[i +1]:
        s2[i] = '0' if s2[i+1] == '1' else '1'
        count2 += 1

print(min(count, count2))
Problem p03272 (python)

Fixed submission:
y = input().split()
print(int(y[0])-int(y[1])+1)

Buggy submission (verdict: Runtime Error):
import math
N,K = map(int, input().split())
a = list(map(int,input().split()))
l = 0
r = K - 1
Min = float("inf")
for i in range(N - K + 1):
    if(a[l]*a[r]<=0):#原点を跨ぐとき
        Min = min(Min,abs(a[l])+abs(a[l]-a[r]),abs(a[r])+abs(a[r]-a[l]))
    elif(l==0):#左端の時
        if(a[r]*a[r+1]<0 or a[0]>0):
            Min = min(Min,abs(a[l])+abs(a[l]-a[r]),abs(a[r])+abs(a[r]-a[l]))
    elif(r==N-1):#右端の時
        if(a[l-1]*a[l]<0 or a[l]>0):
            Min = min(Min,abs(a[l])+abs(a[l]-a[r]),abs(a[r])+abs(a[r]-a[l]))
    else:
        if(a[r]*a[r+1]<0 or a[l-1]*a[l]<0):
            Min = min(Min,abs(a[l])+abs(a[l]-a[r]),abs(a[r])+abs(a[r]-a[l]))
    l = l + 1
    r = r + 1
print(Min)
Problem p03208 (python)

Fixed submission:
NK=input()
ListNK=NK.split() #ListNK[0]=N,[1]=K
N=int(ListNK[0])
K=int(ListNK[1])
Listh=[]
ListQ=[]
for i in range(0,N,1):
  hi=int(input())
  Listh.append(hi)

Listh.sort() #Listhの要素を小さい順に並べる
for i in range(0,N-K+1,1):
  Q=int(Listh[K+i-1]-Listh[i]) #hmax-hminの候補.Qminを求めればよい
  ListQ.append(Q)
ListQ.sort()
print(ListQ[0])

Buggy submission (verdict: Runtime Error):
NK=int(input())
ListNK=NK.split() #ListNK[0]=N,[1]=K
N=int(ListNK[0])
K=int(ListNK[1])
Listh=[]
ListQ=[]
for i in range(0,N,1):
  hi=int(input())
  Listh.append(hi)

Listh.sort() #Listhの要素を小さい順に並べる
for i in range(0,N-K,1):
  Q=int(Listh[K+i-1]-Listh[i]) #hmax-hminの候補.Qminを求めればよい
  ListQ.append(Q)
ListQ.sort()
print(ListQ[0])

Buggy submission (verdict: Runtime Error):
NK=int(input())
ListNK=NK.split() #ListNK[0]=N,[1]=K
N=ListNK[0]
K=ListNK[1]
Listh=[]
ListQ=[]
for i in range(0,N,1):
  hi=int(input())
  Listh.append(hi)

Listh.sort() #Listhの要素を小さい順に並べる
for i in range(0,N-K+1,1):
  Q=int(Listh[K+i-1]-Listh[i]) #hmax-hminの候補.Qminを求めればよい
  ListQ.append(Q)
ListQ.sort()
print(ListQ[0])
Problem p03327 (python)

Fixed submission:
a=int(input())
if a<=999:
    print("ABC")
else:
    print("ABD")

Buggy submission (verdict: Runtime Error):
a=input()
if a<=999:
    print("ABC")
else:
    print("ABD")
Problem p03042 (python)

Fixed submission:
a = input()
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
     print("MMYY")
elif 0<under<13 and (1>over or over>12):
     print("YYMM")
else:
     print("NA")

Buggy submission (verdict: Runtime Error):
a = input()
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
   print("YYMM")
elif(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
     print("NA")

Buggy submission (verdict: Runtime Error):
a = input()
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
   print("YYMM")
elif(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
   print("NA")

Buggy submission (verdict: Runtime Error):
a = str(input())
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
   print("YYMM")
elif(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
   print("NA")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = str(a)
over = int(b[:2])
under = int(b[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
   print("YYMM")
elif(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
   print("NA")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = str(a)
over = int(b[:2])
under = int(b[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
else if 0<over<13 and (1>under or under>12):
   print("YYMM")
else if(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
   print("NA")
Problem p03072 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
sum = 1
for i in range(1,n):
  if max(h[:i])<=h[i]:
     sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count = 0
sum = 1
for i in range(1,n+1):
  for s in range(i-1,-1,-1):
    if h[i]>=h[s]:
      count+=1
  if count==i:
       sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count = 0
sum = 1
for i in range(1,n+1):
  for s in range(i-1,-1,-1):
    if h[i]>=h[s]:
      count+=1
  if count==i:
       sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count = 0
sum = 0
for i in range(1,n):
  　for s in range(i-1,0):
      if h[i]>h[s]:
         count+=1
    if count==n:
       sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count=0
sum=1
for(int i=1;i>=n;i++):
    for(int s=i-1;s>=0;s--):
      if h[i]>h[s]:
         count+=1
    if count==n:
       sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count=0
sum=1
for(i=1;i>=n;i++):
    for(s=i-1;s>=0;s--):
      if h[i]>h[s]:
         count+=1
    if count==n:
       sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count=0
sum=0
for i in range(n):
    for(s=i-1;s>=0;s--):
      if h[i]>h[s]:
         count+=1
    if count==n:
       sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
count=0
sum=0
for i in range(n):
    for(s=i-1;s>=0;s--):
     if h[i]>h[s]:
         count+=1
    if count==n:
       sum+=1
print(sum)
Problem p03075 (python)

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


def main():
    alpha = [int(input()) for _ in range(5)]
    k = int(input())

    for a in alpha:
        for b in alpha:
            if abs(a - b) > k:
                print(':(')
                exit()

    print('Yay!')


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
H,W=map(int,intput().split())
h,w=map(int,input().split())
print(W*H-h*W-H*w+h*w)

Buggy submission (verdict: Runtime Error):
 alpha=[int(intput()) for_in range(5)]
    k=int(intput())
    for a in alpha:
        for b in alpha:
            if abs(a-b)>k:
                print (':(')
                exit()
    print('Yay!')

Buggy submission (verdict: Runtime Error):
def main():
    alpha=[int(intput()) for _in range(5)]
    k=int(intput())
    for a in alpha:
        for b in alpha:
            if abs(a-b)>k:
                print (':(')
                exit()
    print('Yay!')

Buggy submission (verdict: Runtime Error):
def main():
    alpha=[int(intput()) for_in range(5)]
    k=int(intput())
    for a in alpha:
        for b in alpha:
            if abs(a-b)>k:
                print (':(')
                exit()
    print('Yay!')
Problem p03834 (python)

Fixed submission:
print(" ".join(input().split(",")))

Buggy submission (verdict: Runtime Error):
print(" ".join(input().split(,)))
Problem p03075 (python)

Fixed submission:
a = int(input())
for _ in range(3):
    input()
e = int(input())
k = int(input())
if e-a > k:
    print(':(')
else:
    print('Yay!')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if (e - a <= f):
    print("Yay!")
else:
    print(":(")
Problem p03307 (python)

Fixed submission:
N = int(input())
if N % 2 == 0:
  print(N)
else:
  print(2*N)

Buggy submission (verdict: Runtime Error):
N = input()
if N % 2 == 0:
  print(N)
else:
  print(2*N)
Problem p03631 (python)

Fixed submission:
N = input()
print("Yes" if N[0]==N[2] else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
print("Yes" if N[0]==N[2] else "No")
Problem p03036 (python)

Fixed submission:
r, D, x = map(int, input().split())

for i in range(10) :
  x = r*x - D
  print(x)

Buggy submission (verdict: Runtime Error):
r, D, x = map(int, input().split())

for i in range(10) :
  x = rx + D
  print(x)
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
s = input()
if s[k-1] == 'A':
  print(s[:k-1] + 'a' + s[k:])
elif s[k-1] == 'B':
  print(s[:k-1] + 'b' + s[k:])
else :
  print(s[:k-1] + 'c' + s[k:])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
if s[k-1] == 'A' :
  print(s[:k-2] + 'a' + s[k:n])
elif s[k-1] == 'B' :
  print(s[:k-2] + 'b' + s[k:n])
else s[k-1] == 'C' :
  print(s[:k-2] + 'c' + s[k:n])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = list(input())
if s[k-1] == 'A' :
  print(s[:k-2] + 'a' + s[k:n])
elif s[k-1] == 'B' :
  print(s[:k-2] + 'b' + s[k:n])
else s[k-1] == 'C' :
  print(s[:k-2] + 'c' + s[k:n])