Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
ea=min(A,K)
A-=ea
K-=ea
eb=min(B,K)
B-=eb
k-=eb
print(A,B)

Fixed submission:
a, b, k = map(int, input().split())
 
if a >= k:
    print(a - k, b)
else:
    print(0, max(0, b - k + a))

Buggy python submission (verdict: Time Limit Exceeded):
A,B,K=map(int,input().split())
while(K!=0):
	K-=1
	if A>=1:
		A-=1
	elif B>=1:
		B-=1
	elif A==B:
		break
print(A,B)

Fixed submission:
a, b, k = map(int, input().split())
 
if a >= k:
    print(a - k, b)
else:
    print(0, max(0, b - k + a))
Buggy python submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())
if n % k == 0:
	x= n//k
    print(x*math.factorial(k))
"""else:
	r= n % k
	div=n-r
	y=div//k
	sum= y*(math.factorial(k))
	z=nCr(k,r)
	sum+=z
	print(sum)
    """


def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)

Fixed submission:
n,k=map(int,input().split())
print(k*(k-1)**(n-1))

Buggy python submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())
if n % k == 0:
	x= n//k
	print(x*math.factorial(k))
else:
	r= n % k
	div=n-r
	y=div//k
	sum= y*(math.factorial(k))
	z=nCr(k,r)
	sum+=z
	print(sum)


def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)

Fixed submission:
n,k=map(int,input().split())
print(k*(k-1)**(n-1))
Buggy python submission (verdict: Runtime Error):
string = list(input());
if (string[2] == string[3] && string[4] == string[5]):
	print("Yes");
else:
    print("No");

Fixed submission:
string = list(input());
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
string = list(input());
if (string[2] == string[3] and string[4] == string[5]):
	print("Yes");
  else:
    print("No");

Fixed submission:
string = list(input());
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
string = list(input());
if (string[2] == string[3] && string[4] == string[5]):
	print("Yes");
  else:
    print("No");

Fixed submission:
string = list(input());
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
string = list(input("");
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Fixed submission:
string = list(input());
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
string = input().split();
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Fixed submission:
string = list(input());
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))

for i in range(N):
	print (A.count(i+1))

Fixed submission:
import collections

N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))


c = collections.Counter(A)

for i in range(N):
	print (c[i+1])
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(a):
    return reduce(math.gcd, a)

a=[0,0,0]
N = int(input())

wa=0
for i in range(1, N+1):
    a[0]=i
    for j in range(1,N+1):
        a[1]=j
        for k in range(1,N+1):
            a[2]=k
            
            wa=wa+gcd(a)

print(wa)


Fixed submission:
import math
from functools import reduce

def gcd(a):
    return reduce(math.gcd, a)

a=[0,0,0]
N = int(input())

wa=0
for i in range(1, N+1):
    a[0]=i
    for j in range(1,N+1):
        a[1]=j
        for k in range(1,N+1):
            a[2]=k
            
            wa=wa+gcd(a)

print(wa)

Buggy python submission (verdict: Time Limit Exceeded):
import math
a=[0,0,0]
N = int(input())

wa=0
for i in range(1, N+1):
    a[0]=i
    for j in range(1,N+1):
        a[1]=j
        for k in range(1,N+1):
            a[2]=k
            
            ans = a[0]

            for l in range(1, 3):
                ans = math.gcd(ans, a[l])

            wa=wa+ans

print(wa)


Fixed submission:
import math
from functools import reduce

def gcd(a):
    return reduce(math.gcd, a)

a=[0,0,0]
N = int(input())

wa=0
for i in range(1, N+1):
    a[0]=i
    for j in range(1,N+1):
        a[1]=j
        for k in range(1,N+1):
            a[2]=k
            
            wa=wa+gcd(a)

print(wa)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
print(n * 2 * math.p)

Fixed submission:
from math import pi
n = int(input())
print(2 * pi * n)
Buggy python submission (verdict: Runtime Error):
input_line = int(input())
ans = [0] * input_line

inputs = input().split(' ')
inputs = list(map(int, inputs))
for e in inputs:
  for i in range(1, input_line):
    if e == i:
      ans[i] += 1

for i in range(len(ans)):
  print(ans[i])

Fixed submission:
input_line = input().split(' ')
input_line = list(map(int, input_line))
input_assign = input().split(' ')
input_assign = list(map(int, input_assign))

len = input_line[0] - sum(input_assign)
if len < 0:
  print(-1)
else:
  print(len)

Buggy python submission (verdict: Runtime Error):
input_line = input().split(' ')
days = input_line[0]
assignments = input_line[1]

input_assign = input().split(' ')

how_many_days = sum(input_assign)

len = days - how_many_days
if len < 0:
  print(-1)
else:
  print(len)

Fixed submission:
input_line = input().split(' ')
input_line = list(map(int, input_line))
input_assign = input().split(' ')
input_assign = list(map(int, input_assign))

len = input_line[0] - sum(input_assign)
if len < 0:
  print(-1)
else:
  print(len)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

K=int(input())

def gcd(*numbers):
    return reduce(math.gcd, numbers)
sum = 0

for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            sum += gcd(a, b, c)

print(sum)

Fixed submission:
K=int(input())

cache = [1, 
9, 
30, 
76, 
141, 
267, 
400, 
624, 
885, 
1249, 
1590, 
2208, 
2689, 
3411, 
4248, 
5248, 
6081, 
7485, 
8530, 
10248, 
11889, 
13687, 
15228, 
17988, 
20053, 
22569, 
25242, 
28588, 
31053, 
35463, 
38284, 
42540, 
46581, 
50893, 
55362, 
61824, 
65857, 
71247, 
76884, 
84388, 
89349, 
97881, 
103342, 
111528, 
120141, 
128047, 
134580, 
146316, 
154177, 
164817, 
174438, 
185836, 
194157, 
207927, 
218812, 
233268, 
245277, 
257857, 
268182, 
288216, 
299257, 
313635, 
330204, 
347836, 
362973, 
383709, 
397042, 
416448, 
434025, 
456967, 
471948, 
499740, 
515581, 
536073, 
559758, 
583960, 
604833, 
633651, 
652216, 
683712, 
709065, 
734233, 
754734, 
793188, 
818917, 
846603, 
874512, 
909496, 
933081, 
977145, 
1006126, 
1041504, 
1073385, 
1106467, 
1138536, 
1187112, 
1215145, 
1255101, 
1295142, 
1342852, 
1373253, 
1422195, 
1453816, 
1502376, 
1553361, 
1595437, 
1629570, 
1691292, 
1726717, 
1782111, 
1827492, 
1887772, 
1925853, 
1986837, 
2033674, 
2089776, 
2145333, 
2197483, 
2246640, 
2332104, 
2379085, 
2434833, 
2490534, 
2554600, 
2609625, 
2693919, 
2742052, 
2813988, 
2875245, 
2952085, 
3003306, 
3096024, 
3157249, 
3224511, 
3306240, 
3388576, 
3444609, 
3533637, 
3591322, 
3693924, 
3767085, 
3842623, 
3912324, 
4027884, 
4102093, 
4181949, 
4270422, 
4361548, 
4427853, 
4548003, 
4616104, 
4718640, 
4812789, 
4918561, 
5003286, 
5131848, 
5205481, 
5299011, 
5392008, 
5521384, 
5610705, 
5739009, 
5818390, 
5930196, 
6052893, 
6156139, 
6239472, 
6402720, 
6493681, 
6623853, 
6741078, 
6864016, 
6953457, 
7094451, 
7215016, 
7359936, 
7475145, 
7593865, 
7689630, 
7886244, 
7984165, 
8130747, 
8253888, 
8403448, 
8523897, 
8684853, 
8802826, 
8949612, 
9105537, 
9267595, 
9376656, 
9574704, 
9686065, 
9827097, 
9997134, 
10174780, 
10290813, 
10493367, 
10611772, 
10813692, 
10962213]

print(cache[K-1])
Buggy python submission (verdict: Time Limit Exceeded):
def check(x,a,b,c):
    if x==a or x==b or x==c:
        return False
    return True


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

ans=[]

for i in range(n):
    for j in range(i+1,n):
        for z in range(j+1,n):
            a1=a[i]
            b1=a[j]
            c1=a[z]

            if a1+b1>c1 and a1+c1>b1 and c1+b1>a1:
                ans.append([i,j,z])
count =0


print(len(ans))
# for i in range(len(ans)):
#     for j in range(i+1,len(ans)):
#         if check(ans[i][0],ans[j][0],ans[j][1],ans[j][2]):
#             count+=1
#         elif check(ans[i][1],ans[j][0],ans[j][1],ans[j][2]):
#             count+=1
#         elif check(ans[i][2],ans[j][0],ans[j][1],ans[j][2]):
#             count+=1
# 
# 
# print(count)


Fixed submission:


def find(arr):

	n = len(arr)
	arr.sort()
	count = 0
	for i in range(0,n-2):

		k = i + 2

		for j in range(i+1,n):
			while (k < n and arr[i] + arr[j] > arr[k]): 
				k += 1
			if(k>j):
				count += k - j - 1

	return count

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


print(find(a))
Buggy python submission (verdict: Runtime Error):
input_int_list = list(map(int, input().split()))


N = input_int_list[0]
M = input_int_list[1]

Q_ans_list = [0] * N

ans_correct = 0
ans_penalty = 0

for i in range(M):
	input_list_i = list( input().split())
	Q_num = int(input_list_i[0])
	if input_list_i[1] == "WA":
		if Q_ans_list[Q_num] != -1:
			Q_ans_list[Q_num] = Q_ans_list[Q_num] + 1
	elif input_list_i[1] == "AC":
		if Q_ans_list[Q_num] != -1:
			ans_correct = ans_correct + 1
			ans_penalty = ans_penalty + Q_ans_list[Q_num]
			Q_ans_list[Q_num] = -1





print(ans_correct,ans_penalty)



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


N = input_int_list[0]
M = input_int_list[1]

Q_ans_list = [0] * (N+1)

ans_correct = 0
ans_penalty = 0

for i in range(M):
	input_list_i = list( input().split())
	Q_num = int(input_list_i[0])
	if input_list_i[1] == "WA":
		if Q_ans_list[Q_num] != -1:
			Q_ans_list[Q_num] = Q_ans_list[Q_num] + 1
	elif input_list_i[1] == "AC":
		if Q_ans_list[Q_num] != -1:
			ans_correct = ans_correct + 1
			ans_penalty = ans_penalty + Q_ans_list[Q_num]
			Q_ans_list[Q_num] = -1





print(ans_correct,ans_penalty)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [0]
l.extend(list(map(int, input().split(" "))))

for d, i in enumerate(l):
    print(sum(map(lambda x: x == d + 1, l)))

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

h = [0] * n
for i in l:
    h[i - 1] += 1

for i in h:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K = map(int,input().split())
p = input().split()

exps = []
ans = []

for ii in range(N):  
  p[ii] = int(p[ii])
  exps.append(p[ii]*(p[ii]+1)/(2*p[ii]))

for ii in range(K-1,N):
  ans.append(np.sum(exps[ii-K+1:ii+1]))
    

print(np.max(ans))

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

res = []

res.append((sum(range(1,p[0]+1)))/p[0])

for i in range(1,N):
  #res.append(res[i-1] + p[i]*(p[i]+1)/(2*p[i]))
  res.append(res[i-1] + 0.5*(p[i]+1))
  #res.append(res[i-1] + 1 + 0.5*(p[i]-1))

ans=res[K-1]

for i in range(1,N-K+1):
  ans = max(ans,res[i+K-1] - res[i-1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K = map(int,input().split())
p = input().split()

exps = []
ans = []

for ii in range(N):  
  p[ii] = int(p[ii])
  e = np.arange(1,p[ii]+1)
  exps.append(np.sum(e)/p[ii])

for ii in range(K-1,N):
  ans.append(np.sum(exps[ii-K+1:ii+1]))
    

print(np.max(ans))

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

res = []

res.append((sum(range(1,p[0]+1)))/p[0])

for i in range(1,N):
  #res.append(res[i-1] + p[i]*(p[i]+1)/(2*p[i]))
  res.append(res[i-1] + 0.5*(p[i]+1))
  #res.append(res[i-1] + 1 + 0.5*(p[i]-1))

ans=res[K-1]

for i in range(1,N-K+1):
  ans = max(ans,res[i+K-1] - res[i-1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K = map(int,input().split())
p = input().split()

maxval = 0
idx = 0
for ii in range(N):
  
  p[ii] = int(p[ii])
  if ii - K >= 0:
    val = np.sum(p[ii-K+1:ii+1])
    if val > maxval:
      maxval = val
      idx = ii

ans = 0
for ii in range(idx-K+1,idx+1):
  an = np.arange(1,p[ii]+1)
  ans += np.sum(an)/p[ii]

#ans = 1*1/6 + 2*1/6 + 3*1/6 + 4*1/6 + 5*1/6 + 6*1/6
#ans = 1/2 + 2/2 + 1/4 + 2/4 + 3/4 + 4/4 + 1/5 + 2/5 + 3/5+ 4/5 + 5/5
print(ans)

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

res = []

res.append((sum(range(1,p[0]+1)))/p[0])

for i in range(1,N):
  #res.append(res[i-1] + p[i]*(p[i]+1)/(2*p[i]))
  res.append(res[i-1] + 0.5*(p[i]+1))
  #res.append(res[i-1] + 1 + 0.5*(p[i]-1))

ans=res[K-1]

for i in range(1,N-K+1):
  ans = max(ans,res[i+K-1] - res[i-1])
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = map(int,input().split())

numAC = [0]*N
numWA = [0]*N
flgAC = [0]*N

#print(num)

for ii in range(M):
  pi,Si = input().split()
  pi = int(pi)
  
  if flgAC[pi] == 0:
    if Si == "AC":
      numAC[pi] = 1
      flgAC[pi] = 1
    elif Si == "WA":
      numWA[pi] += 1

print(np.sum(numAC),np.sum(numWA))

Fixed submission:
import numpy as np

N,M = map(int,input().split())

#numAC = [0]*N
numWA = [0]*N
flgAC = [0]*N

#print(num)

for ii in range(M):
  pi,Si = input().split()
  pi = int(pi) - 1 #indexとして使うので-1する
  
  if flgAC[pi] == 0:
    if Si == "AC":
      #numAC[pi] = 1
      flgAC[pi] = 1
    elif Si == "WA":
      numWA[pi] += 1

countWA = 0
for ii in range(N):
  if flgAC[ii] == 1:
    countWA += numWA[ii]
print(np.sum(flgAC),countWA)
Buggy python submission (verdict: Runtime Error):
s = input().split()
i = s[0]
m = int(s[1])
j = 0
el = input().split()
for p in el:
    if int(p) < 1 / (4 * m):
      j = 1 
if j == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
el = input().split()
print("{} {} {}".format(el[2],el[0],el[1]))

Buggy python submission (verdict: Runtime Error):
s = input().split()
i = s[0]
m = int(s[1])
j = 0
el = input().split()
for p in el:
    if int(p) < 1 / (4 * m):
      j = 1 
if j == 0:
    print("Yes")
else:
    print("No")


Fixed submission:
el = input().split()
print("{} {} {}".format(el[2],el[0],el[1]))

Buggy python submission (verdict: Runtime Error):
s = input().split()
i = s[0]
m = int(s[1])
j = 0
el = input().split()
for p in el:
    if int(p) < (1 / (4 * m)):
      j = 1 
if j == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
el = input().split()
print("{} {} {}".format(el[2],el[0],el[1]))
Buggy python submission (verdict: Runtime Error):
s = input().split()
i = s[0]
m = s[1]
j = 0
el = input().split()
for p in el:
    if int(p) < 1 / (4 * m):
      j = 1 
if j == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input().split()
i = s[0]
m = int(s[1])
count = 0
sun = 0
el = input().split()
for p in el:
    sun += int(p)
for k in el:
    if int(k) >= sun / (4 * m):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = input().split()
i = s[0]
m = s[1]
j = 0
el = input().split()
for p in el:
  if int(p) < 1 / (4 * m):
    j = 1
     
if j == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
s = input().split()
i = s[0]
m = int(s[1])
count = 0
sun = 0
el = input().split()
for p in el:
    sun += int(p)
for k in el:
    if int(k) >= sun / (4 * m):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
s = input().split()
i = s[0]
m = s[1]
j = 0
el = input().split()
for p in el:
  if p < 1 / (4 * m):
    j = 1

if j == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
s = input().split()
i = s[0]
m = int(s[1])
count = 0
sun = 0
el = input().split()
for p in el:
    sun += int(p)
for k in el:
    if int(k) >= sun / (4 * m):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x = input().split
n = int(x[0])
m = int(x[1])
if n == 0:
  print(m * (m -1) /2)
elif m == 0:
  print(n * (n - 1) / 2)
else:
  k = m * (m -1) /2 + n * (n - 1) / 2
  print(k)

Fixed submission:
x = input().split()
n = int(x[0])
m = int(x[1])
if n == 0:
  print(int(m * (m -1) /2))
elif m == 0:
  print(int(n * (n - 1) / 2))
else:
  k = m * (m -1) /2 + n * (n - 1) / 2
  print(int(k))
Buggy python submission (verdict: Runtime Error):
x = input()
li = x.split()
age = li[0]
m = li[1]
if(age <= 5):
  print(0)
elif(age <= 12):
  printf(m / 2)
else:
  print(m)

Fixed submission:
x = input()
li = x.split()
age = int(li[0])
m = int(li[1])
if(age <= 5):
  print(0)
elif(age <= 12):
  print(int(m / 2))
else:
  print(m)
Buggy python submission (verdict: Runtime Error):
li = input("lkdfkgkfg").split()
t = 0
s = int(li.pop(5))
for i in li:
    for k in li:
        if int(k) - int(i) >= s:
            t = 1

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

while True:
    s += 1

Fixed submission:
li = []
for l in range(6):
    li.append(input())

t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) > int(s):
            t = 1
        elif int(i) - int(k) > int(s):
            t = 1

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

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

li = input().split("")
t = 0
s = int(li.pop(5))
for i in li:
    for k in li:
        if int(k) - int(i) >= s:
            t = 1

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

while True:
    s += 1

Fixed submission:
li = []
for l in range(6):
    li.append(input())

t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) > int(s):
            t = 1
        elif int(i) - int(k) > int(s):
            t = 1

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

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

li = input("lkdfkgkfg").split()
t = 0
s = int(li.pop(5))
for i in li:
    for k in li:
        if int(k) - int(i) >= s:
            t = 1

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

Fixed submission:
li = []
for l in range(6):
    li.append(input())

t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) > int(s):
            t = 1
        elif int(i) - int(k) > int(s):
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
li = input().split()
if li[0] * li[1] % 2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
li = input().split()
a = int(li[0])
b = int(li[1])
if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
if a * b % 2 == 0:
  print(Even)
else:
  print(Odd)

Fixed submission:
li = input().split()
a = int(li[0])
b = int(li[1])
if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
s = input()
li = input().split()
t = 0
li2 = []
for i in li:
    t  = 0
    while True:
        if int(i) % 2 == 0:
            i = int(i) / 2
            t += 1
        else:
            li2.append(t)
            break

li2.sort()
ans = li2[0]
print(ans)

Fixed submission:
li = list(input())
ans = 0
for i in li:
    if int(i) == 1:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
li = input().split()
ans = 1
t = 0
li2 = []
while True:
    for i in li:
        if int(i) % 2 == 0:
            li2.append(int(i)/2)
        else:
            t = 1
    if t == 1:
        break
    else:
        ans += 1
        li = li2

print(ans)

Fixed submission:
li = list(input())
ans = 0
for i in li:
    if int(i) == 1:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import numpy as np


def main():
    N = int(input())
    P = list(map(int, input().split()))

    count = 0
    for i in range(N):
        m = min(P[:i+1])
        # print(i+1, Q)
        if m == P[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import numpy as np


def main():
    N = int(input())
    P = list(map(int, input().split()))

    count = 0
    min_P = 200000
    for i in range(N):
        if min_P > P[i]:
            min_P = P[i]
        if min_P == P[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import numpy as np


def main():
    N = int(input())
    P = list(map(int, input().split()))

    count = 0
    for i in range(N):
        Q = sorted(P[:i+1], reverse=True)
        # print(i+1, Q)
        if Q[-1] == P[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import numpy as np


def main():
    N = int(input())
    P = list(map(int, input().split()))

    count = 0
    min_P = 200000
    for i in range(N):
        if min_P > P[i]:
            min_P = P[i]
        if min_P == P[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
import numpy as np


def main():
    N = int(input())
    P = list(map(int, input().split()))

    count = 0
    P = np.array(P)
    for i in range(N):
        # print(i+1, np.count_nonzero(P[:i+1]-P[i] >= 0), P[:i+1])
        if np.count_nonzero(P[:i+1]-P[i] >= 0) == i+1:
            count += 1
    print(count)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import numpy as np


def main():
    N = int(input())
    P = list(map(int, input().split()))

    count = 0
    min_P = 200000
    for i in range(N):
        if min_P > P[i]:
            min_P = P[i]
        if min_P == P[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from https://github.com/kmyk/online-judge-tools

## Login
oj login URL

## DownLoad
oj dl URL

## test
oj test [-c COMMAND]
* Write the following in the first line of the python script
```python
#!/usr/bin/env python3
```


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    A = list(map(int, input().split()))

    if sum(A) > 21:
        print("bust")
    else:
        print("win")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K, Q = list(map(int, input().split()))

p = [K] * N
p = np.array(p)

for _ in range(Q):
    A = int(input()) - 1
    p -= 1
    p[A] += 1

for pp in p:
    if pp > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
# import numpy as np
N, K, Q = list(map(int, input().split()))

p = [0] * N
# p = np.array(p)

# for _ in range(Q):
#     A = int(input()) - 1
#     p -= 1
#     p[A] += 1

for _ in range(Q):
    A = int(input()) - 1
    p[A] += 1

sum_p = sum(p)
# print(p)
for pp in p:
    if (pp + K) > sum_p:
        print("Yes")
    else:
        print("No")