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

Fixed submission:
def main():
    from sys import stdin
    from bisect import bisect_left

    readline = stdin.readline
    n, m = map(int, readline().split())
    data = [list(map(int, readline().split())) for _ in range(m)]
    t = [[] for _ in range(n)]

    for p, y in data:
        t[p - 1].append(y)

    for i in range(n):
        t[i].sort()

    for p, y in data:
        nth = bisect_left(t[p - 1], y) + 1
        print("%06d%06d" % (p, nth))

main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m = map(int, input().split())
    query = []
    result =  [[] for i in range(n)]
    for i in range(m):
        qList = list(map(int, input().split()))
        query.append(qList)
        result[qList[0]-1].append(qList[1])
 
    for i in result:
        i.sort()
 
    for city in query:
        rank = bisect.bisect_left(result[city[0]-1], city[1])
        ans = "%06d%06d"%(city[0],rank+1)
        print(ans)
 
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():

    input = sys.stdin.readline

    n, m = map(int, input().split())
    query = []
    result =  [[] for i in range(n)]
    for _ in range(m):
        p, y = map(int, input().split())
        query.append((p, y))
        result[p-1].append(y)

    result = [sorted(i) for i in result]
 
    for city in query:
        rank = result[city[0]-1].index(city[1])+1
        resultStr = "{}{}".format(str(city[0]).zfill(6), str(rank).zfill(6))
        print(resultStr)

main()

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
query = []
for i in range(m):
    qList = list(map(int, input().split()))
    query.append(qList)

for city in query:
    result[city[0]-1].append(city[1])

for i in range(n):
    result[i].sort()

for city in query:
    rank = result[city[0]-1].index(city[1])+1
    prefStr = "0"*(6-len(str(city[0]))) + str(city[0])
    rankStr = "0"*(6-len(str(rank))) + str(rank)
    resultStr = "{}{}".format(prefStr, rankStr)
    print(resultStr)
Problem p02594 (python)

Fixed submission:
N = input()
 
A = int(N)
 
if A>=30:
  print('Yes')
else:
  print('No')

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

A = int(N)

if A>=30:
  return 'Yes'
else:
  return 'No'
Problem p02659 (python)

Fixed submission:
a,b=map(float,input().split())
a=int(a)
b=round(b*100)
k=int((a*b)//100)
print(k)

Buggy submission (verdict: Runtime Error):
import math as m
a,b=map(float,input())
k=a*b
print(m.floor(k))
Problem p02689 (python)

Fixed submission:
n,m=map(int,input().split())
hl=input().split()
shl=[int(x) for x in hl]
vl=set()
for i in range(m):
    a,b=map(int,input().split())
    if shl[a-1]>shl[b-1]:
        vl.add(b-1)
    elif shl[a-1]<shl[b-1]:
        vl.add(a-1)
    else:
        vl.add(a-1)
        vl.add(b-1)
lshl=len(shl)
lvl=len(vl)
ans=lshl-lvl
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
hl=input().split()
shl=[int(x) for x in hl]
vl=set()
for i in range(m):
    a,b=map(int,input().split())
    if shl[a-1]>shl[b-1]:
        vl.add(b-1)
    elif shl[a-1]<shl[b-1]:
        vl.add(a-1)
    else:
        vl.add(a-1)
        vl.add(b-1)
    print(vl)
lshl=len(shl)
lvl=len(vl)
ans=lshl-lvl
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
hl=int(input().split())n,m=map(int,input().split())
hl=input().split()
shl=[int(x) for x in hl]
vl=set()
for y in range(n):
    vl.add(y)
print(vl)
for i in range(m):
    try:
        a,b=map(int,input().split())
        if shl[a-1]>shl[b-1]:
            vl.remove(b-1)
        elif shl[a-1]<shl[b-1]:
            vl.remove(a-1)
        else:
            vl.remove(a-1)
            vl.remove(b-1)
    except:
        continue
lshl=len(shl)
lvl=len(vl)
ans=lshl-lvl
print(ans)
Problem p02699 (python)

Fixed submission:
s,w=map(int,input().split())
if s<=w:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
s,w=map(int,input())
if s<=w:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
s,w=map(int,input())
if s<=w:
    print('unsafe')
else:
    print('safe')
Problem p02594 (python)

Fixed submission:
X = int(input())

if -40 <= X <= 40:
  if X >= 30:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
if X >= 30 and X <= 40:
  print('Yes')
elif 
  print('No')
Problem p02725 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    K, N = map(int, readline().split())
    A = list(map(int, readline().split()))
    sorted(A)
    d = [A[i]-A[i-1] for i in range(1,N)]
    d.append(K - max(A) + min(A))
    ans = K-max(d)
    print(ans)
    return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    K, N = map(int, readline().split())
    A = map(int, readline().split())
    ans = max(K - max(A) + min(A),max(A) -min(A))
    print(ans)
    return

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

Fixed submission:
N, M = map(int, input().split())
nC2 = N * (N - 1) / 2
mC2 = M * (M - 1) / 2
print(int(nC2+mC2))

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    from scipy.special import comb
    NM = list(map(int,readline().split()))
    cnt = 0
    for nm in NM:
        if nm <2:
            continue
        else:
            cnt += comb(nm, 2, exact=True)
    print(cnt)
    return

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

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

for i in itertools.count(0):
  if N//(K**i)<K:
    print(i+1)
    break

Buggy submission (verdict: Runtime Error):
import itertools
N,K = map(int,input().split())
for i in itertools.count(1):
  if N//(K**i)>=K:
    continue
else print(i)
Problem p02777 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

def main():
    S,T=input().split()
    A,B=map(int,input().split())
    U=input()
    if S==U:
        A-=1
    else:
        B-=1
    print(A,B)


    return 

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
import sys

def main():
  read = sys.stdin.buffer.read
  N, K, *p = map(int, read().split())
  p = [0] + list(accumulate(p))
  print((max(y - x for x, y in zip(p, p[K:])) + K) / 2)

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

Fixed submission:
a,b=map(int,input().split())
print(str(min(a,b))*max(a,b))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print(str(min(a,b))*max(a,b))
Problem p02831 (python)

Fixed submission:
import fractions
a,b=map(int,input().split())
print(int(a*b/fractions.gcd(a,b)))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
print(a*b/math.gcd(a,b))
Problem p02859 (python)

Fixed submission:
print(int(input())**2)

Buggy submission (verdict: Runtime Error):
print(int(input().split())**2)
Problem p02860 (python)

Fixed submission:
S=int(input())
T=input()
S=int(S)
print('Yes' if T[:S//2]==T[S//2:] else 'No')

Buggy submission (verdict: Runtime Error):
S,T=input().split()
S=int(S)
print('Yes' if T[:S//2]==T[S//2:] else 'No')
Problem p02880 (python)

Fixed submission:
N=int(input())
for i in range(1,10):
  if N%i==0:
    if N/i<10:
      print('Yes')
      break
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N=imt(input())
for i in range(1,10):
  if N%i==0:
    if N/i<10:
      print('Yes')
      break
else:
  print('No')
Problem p02951 (python)

Fixed submission:
A, B, C = map(int,input().split())
if A < B + C :
  print(C - (A - B))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int,input())
if A < B + C :
  print(C - (A - B))
else:
  print(0)
Problem p03012 (python)

Fixed submission:
N = int(input())
W = list(map(int,input().split()))
s = sum(W)
ans = 0
for w in W:
  if abs(s - 2*ans) <= abs(s - 2*(ans + w)):
    break
  else:
    ans += w
print(abs(2*ans-s))

Buggy submission (verdict: Runtime Error):
N = int(iuput())
W = list(map(int,input.split()))
s = sum(W)
ans = 0
for w in W:
  if s - ans <= s - ans + w:
    break
  else:
    ans += w
print(s - ans)
Problem p03041 (python)

Fixed submission:
N,K = map(int, input().split())
S = input()
print(''.join([S[i]if i+1 != K else S[i].lower() for i in range(N)]))

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
S = input()
print(*[s if i != K else s.lower() for i in range(N)])
Problem p03042 (python)

Fixed submission:
S = input()
f = int(S[:2])
s = int(S[2:])
if 1 <= f <= 12:
  if 1 <= s <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif 1 <= s <= 12:
  print('YYMM')
else:
  print('NA')

Buggy submission (verdict: Runtime Error):
S = input()
f = int(S[:2])
s = int(S[2:])
if 1 <= f <= 12:
  if 1 <= s <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif if 1 <= s <= 12:
  print('YYMM')
else:
  print('NA')
Problem p03315 (python)

Fixed submission:
a=input()
plus = a.count('+')
minus = a.count('-')
result=plus-minus
print(result)

Buggy submission (verdict: Runtime Error):
a=input().split()
plus = a.count(+)
minus = a.count(-)
result=plus-minus
print(result)
Problem p03017 (python)

Fixed submission:
import sys
rr = lambda: sys.stdin.readline().strip()
rri = lambda: int(rr())
rrs = lambda: [int(_) for _ in rr().split()]

N, A_, B_, C_, D_ = rrs()
A, B, C, D = [i-1 for i in [A_, B_, C_, D_]]
S = rr()

for i in range(A, max(C, D)):
	if S[i] == '#' and S[i+1] == '#':
		print('No')
		sys.exit()

if C < D:
	print('Yes')
	sys.exit()

if S[B-1] == '.' and S[B+1] == '.':
	print('Yes')
	sys.exit()

if S[B+1] == '.' and S[B+2] == '.':
	print('Yes')
	sys.exit()
	
for i in range(B, D-1):
	if S[i] == '#':
		if S[i+1] == '.' and S[i+2] == '.' and S[i+3] == '.':
			print('Yes')
			sys.exit()

print('No')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
rr = lambda: sys.stdin.readline().strip()
rri = lambda: int(rr())
rrs = lambda: [int(_) for _ in rr().split()]

N, A_, B_, C_, D_ = rrs()
A, B, C, D = [i-1 for i in [A_, B_, C_, D_]]
S = rr()

for i in range(1, N):
	if S[i] == '#' and S[i-1] == '#':
		print('No')
		sys.exit()

if C < D:
	print('Yes')
	sys.exit()

if S[B-1] == '.' and S[B+1] == '.':
	print('Yes')
	sys.exit()

if S[B+1] == '.' and S[B+2] == '.':
	print('Yes')
	sys.exit()

if B == D - 1:
	print('Yes')
        sys.exit()

for i in range(B, D-1):
	if S[i] == '#':
		if S[i+1] == '.' and S[i+2] == '.' and S[i+3] == '.':
			print('Yes')
			sys.exit()

print('No')
sys.exit()
Problem p03042 (python)

Fixed submission:
import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

if not 1 <= int(S[:2]) <= 12:
    if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('YYMM')
elif not 1 <= int(S[2:]) <= 12:
	print('MMYY')
else:
    print('AMBIGUOUS')

Buggy submission (verdict: Runtime Error):
import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

if not 1 <= int(S[:1]) <= 12:
    if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('YYMM')
elif not 1 <= int(S[2:]) <= 12:
	if not 1 <= int(S[1:]) <= 12:
        print('NA')
    else:
        print('MMYY')
else:
    print('AMBIGUOUS')

Buggy submission (verdict: Runtime Error):
import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

if not 1 <= int(S[:1]) <= 12:
    if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('YYMM')
elif not 1 <= int(S[2:]) <= 12:
	if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('MMYY')
else:
    print('AMBIGUOUS')
Problem p03127 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000)
input = sys.stdin.readline

def chkprint(a):
	a_name = ''
	for k, v in globals().items():
		if id(v) == id(a):
			a_name = k
			break
	print(a_name+' = '+str(a), file=sys.stderr)

def mt(f):
	import time
	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		print(e - s, 'sec', file=sys.stderr)
		return ret
	return wrap

@mt
def slv(N, A):
	flag = True
	while len(A) > 1:
		m = min(A)
		A = [a % m for a in A if a % m != 0]
		A.append(m)
		print(A, file=sys.stderr)
	return m


N = int(input())
A = [int(i) for i in input().split()]
'''
N = 5
A = [13, 5, 18, 100000000]
'''
print(slv(N, A))

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

def chkprint(a):
	a_name = ''
	for k, v in globals().items():
		if id(v) == id(a):
			a_name = k
			break
	print(a_name+' = '+str(a), file=sys.stderr)

def mt(f):
	import time
	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		print(e - s, 'sec', file=sys.stderr)
		return ret
	return wrap

@mt
def slv(N, A):
	a = min(A)
	flag = False
	while not flag:
		flag = True
		for i in A:
			if i % a == 0:
				i = a
			else:
				i = i % a
				flag = False
		a = min(A)
	return a
	
N = int(input().split())
A = [int(i) for i in input().split())]
#N = 4
#A = [2, 10, 8, 40]
print(slv(N, A))
Problem p03207 (python)

Fixed submission:
N = int(input())
p = [0] * N
max_value = 0

for i in range(N):
    p[i] = int(input())
    max_value = max(max_value, p[i])

price = sum(p) - max_value / 2
print(int(price))

Buggy submission (verdict: Runtime Error):
N = int(input())
p = [0] * N
max_value = 0

for i in range(N):
    p[i] = int(input())
    max_value = max(max_value, p[i])

price = sum(p) - max_value / 2
print(int(price)
Problem p03242 (python)

Fixed submission:
n = input()
ans = []
for ni in n:
    if ni == '1':
        ans.append('9')
    elif ni == '9':
        ans.append('1')
    else:
        ans.append(ni)
print(ans[0]+ans[1]+ans[2])

Buggy submission (verdict: Runtime Error):
n = input()
ans = []
for ni in n:
    if ni == '1':
        ans.append('9')
    elif ni == '9':
        ans.append('1')
    else:
        ans.append(ni)
print(ans[0]+ans[1]+ans[2])
Problem p03315 (python)

Fixed submission:
#from sys import stdin
#input = stdin.readline

S = input()
n = 0

for i in S:
    if i == '+':
        n += 1
    else:
        n -= 1

print(n)

Buggy submission (verdict: Runtime Error):
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub, itemgetter
import numpy as np

sys.setrecursionlimit(10000)

def read_int():
	return int(sys.stdin.readline().strip())

def read_int_n():
	return [int(x) for x in sys.stdin.readline().strip().split()]

def read_float():
	return float(sys.stdin.readline().strip())

def read_float_n():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def read_str():
	return sys.stdin.readline().strip()

def read_str_n():
	return [str(x) for x in sys.stdin.readline().strip().split()]

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time
	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

@mt
def slv(S):
	c = Counter(S)
	ans = c['+'] - c['-']
	return ans

def main():
	S = read_str()
	print(slv(S))

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

Fixed submission:
K, S = map(int, input().split())
ans = 0
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z <= K:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())
ans = 0
for x in range(K+1):
  for y in range(K+1):
    z = k - x - y
    if 0 <= z <= K:
      ans += 1
print(ans)
Problem p02833 (python)

Fixed submission:
# coding: utf-8
# Your code here!

N = int(input())

if N%2 != 0 : 
    global_cnt = 0
else : 
    n = 1
    while 2*(5**n) <= N : 
        n += 1
        
    global_cnt = 0
    
    for i in range(1, n) : 
        local_cnt = N // (2*(5**i))
        global_cnt += local_cnt
        
print(global_cnt)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

N = int(input())

if N%2 != 0 : 
    print(0)
    
else : 
    n = 1
    while 2*(5**n) <= N : 
        n += 1
        
    global_cnt = 0
    
    for i in range(1, n) : 
        local_cnt = N // (2*(5**i))
        global_cnt += local_cnt
        
print(global_cnt)
Problem p02933 (python)

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

if a < 3200 : 
    print("red")
else : 
    print(s)

Buggy submission (verdict: Runtime Error):
# input
n, q = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(n-1)]
PX = [tuple(map(int, input().split())) for _ in range(q)]

# other_setting
child = [0] * n
parent = [0] * n
value = [0] * n

for i in range(n) : 
    child[i] = []

for a, b in AB : 
    child[a-1].append(b)
    parent[b-1] = a

# op_function
def op(a) : 
    if a != 1 : 
        value[a-1] += value[parent[a-1]-1]

    if child[a-1] != [] : 
        for c in child[a-1] : 
            op(c)
            
# initial_state(value)
for p, x in PX : 
    value[p-1] += x
    
# exe
op(1)

print(*value)
Problem p03075 (python)

Fixed submission:
import itertools as itr

antenna = []

s = 0

for _ in range(5) : 
    antenna.append(int(input()))
    
k = int(input())

l = list(itr.combinations(antenna, 2))

for i in l : 
    if (abs(i[0] -i[1])) > k :
        s = 1

if (s == 0) : 
    print("Yay!")
else : 
    print(":(")

Buggy submission (verdict: Runtime Error):
X,Y,Z,K = map(int, input().split())


A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
D = []
E2 = []
F = []

# A + Bの全列挙 からのソート 

for i in A : 
    for j in B : 
        D.append(i+j)
        
E = sorted(D, reverse = True)

if len(E) > K : 
    for i in range(K) : 
        E2.append(E[i])
else : 
    E2 = E
        
####

for i in E2 : 
    for j in C : 
        F.append(i+j)
        
G = sorted(F, reverse = True)

for i in range(K) : 
    print(G[i])
Problem p02819 (python)

Fixed submission:
x = int(input())

while True:
    c = 0
    for i in range(2, x+1):
        if x % i == 0:
            c += 1
    if c == 1:
        print(x)
        exit()
    else:
        x += 1

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

while True:
    c = 0
    for i in range(2, x+1):
        if x % i == 0:
            c += 1
    if cnt == 1:
        print(x)
        exit()
    else:
        x += 1
Problem p02831 (python)

Fixed submission:
import fractions

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

n = fractions.gcd(a, b)

if n == 1:
  print(a*b)
else:
  a = a//n
  print(a*b)

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

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

n = math.gcd(a, b)

if n == 1:
  print(a*b)
else:
  a = a//n
  print(a*b)
Problem p02847 (python)

Fixed submission:
s = str(input())

l = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(1,8):
    if s == l[i-1]:
        print(8-i)

Buggy submission (verdict: Runtime Error):
s = str(input())s = str(input())

l = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(1,8):
    if s == l[i-1]:
        print(8-i)
Problem p02989 (python)

Fixed submission:
N = int(input())

D = [int(i) for i in input().split()]

D2 = sorted(D)
A = D2[N//2-1]
B = D2[N//2]
print(abs(A-B))

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

D = [int(i) for i in input().split()]

D2 = sorted(D)
A = D2[N//2]
B = D2[N//2+1]
print(abs(A-B))
Problem p03041 (python)

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

p = input()

print(p[:k-1] + p[k-1].lower() + p[k:])

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

a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])

if a>12 and b>12:
    print('NA')
elif a>12 and 1<=b<=12:
    print('YYMM')
elif 1<=a<=12 and b>12:
    print('MMYY')
else:
    print('AMBIGUOUS')
Problem p03072 (python)

Fixed submission:
n = int(input())

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

mountain = int(1)
for i in range(1, n):
    for j in range(i):
        if int(L[j]) > int(L[i]):
            break
        if int(L[j]) <= int(L[i]) and j == i-1:
            mountain += 1
            break
        if int(L[j]) <= int(L[i]):
            continue

print(mountain)

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

L = list(int,input().split())

mountain = int(1)
for i in range(1,n):
    for j in range(i):
            if int(L[j]) >= int(L[i]):
          			break
            else:
                    mountain += 1
                
print(mountain)

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

L = list(int,input().split())

mountain = int(1)
for i in range(n):
    for j in range(i):
            if int(L[j]) >= int(L[i]):
          			continue
            else:
                    mountain += 1
                
print(mountain)
Problem p02594 (python)

Fixed submission:
x=int(input())
if(x>=30):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x=int(input())
if(x>=30):
  print("Yes")
else:
  prinit("No")
Problem p02594 (python)

Fixed submission:
x = input()
if int(x) >= 30:
  print("Yes")
else:
  print("No")

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

count = 0

for i in range(N):
  x, y = map(int, input().split())
  if D > pow(x**2+y**2, 0.5):
    count += 1
  else:
    continue
    
print(count)
Problem p02595 (python)

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

count = 0

for i in range(N):
    x, y = map(int, input().split())
    if D >= pow(x**2+y**2, 0.5):
        count += 1
    
print(count)

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

count = 0

for i in N:
  x, y = map(int, input().split())
  if D > pow(x**2+y**2, 0.5):
    count += 1
  else:
    continue
    
print(count)
Problem p02777 (python)

Fixed submission:
S,T = input().split()
A,B = input().split()
U = input()

if U == S:
  print(int(A)-1, B)
else:
  print(A, int(B)-1)

Buggy submission (verdict: Runtime Error):
S,T = input().split()
A,B = input().split()
U = input()

if U = S:
  print(A-1)
else:
  print(B-1)
Problem p02594 (python)

Fixed submission:
n = int(input())
if n >= 30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import sys
import math

input = sys.stdin.readline

def can(arr, m, K):
  need = 0
  for x in arr:
    need += int(x // m)
  return need <= K

N, K = map(int, input().split())
arr = list(map(int, input().split()))
arr = sorted(arr)

lo = 0.0
hi = 1e9

while (abs(lo - hi) > 1e-5):
  m = (lo + hi) / 2.0
  if (can(arr, m, K)):
    hi = m
  else:
    lo = m
ans = lo

print(int(math.ceil(lo)))

Buggy submission (verdict: Runtime Error):
    n = int(input())
    if n >= 30:
      s = 'Yes'
    else:
      s = 'No'
    print(s)
Problem p02597 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n = int(input())
s = input()
ans = 0
r = [0] * n
w = [0] * n
for i in range(n):
  if s[i] == 'W':
    w[i] += 1
  else:
    r[i] += 1
for i in range(1, n):
  w[i] += w[i - 1]
  r[i] += r[i - 1]
rn = r[n - 1]
ans = n
if rn == 0:
  ans = 0
for i in range(n):
  c = (i + 1)
  ri = r[i]
  left = rn - ri
  need = c - ri
  ans = min(ans, max(left, need))  

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n = int(input())
s = input()
ans = 0
for i in range(n - 1):
  idx = n - 1 - i
  if s[idx] == 'W' and s[idx + 1] == 'R':
    ans += 1
    s[idx] = 'R'
print(ans)