Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())

l = [i for i in range(55556)]
l[1] = 0
for i in l[1:]:
    if i > math.sqrt(55556): break
    if i == 0 :continue
    for j in range(2*i,55556,i): l[j] = 0

prime = [i for i in l if (l != 0 and (i - 3)%10 == 0)]
print(" ".join(map(str,prime[:N])))


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

if a <= b :
    print(a)
else :
    print(a-1)

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

l = [i for i in range(55556)]
l[1] = 0
for i in l[1:]:
    if i > math.sqrt(55556): break
    if i == 0 :continue
    for j in range(2*i,55556,i): l[j] = 0

prime = [i for i in l if (l != 0 and (i - 3)%10 == 0)]
print(" ".join(map(str,prime[:N])))


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

if a <= b :
    print(a)
else :
    print(a-1)
Buggy python submission (verdict: Time Limit Exceeded):
n,c = map(int,input().split())
l = [[0,0] for _ in range(n)]
dp1 = [0 for _ in range(n)]
dp2 = [0 for _ in range(n)]
for i in range(n):
    l[i] = list(map(int, input().split()))

dp1[0] = l[0][1] - l[0][0]
dp2[0] = l[-1][1] - c + l[-1][0]
for i in range(1,n):
    dp1[i] = dp1[i-1] + l[i][1] - l[i][0] + l[i-1][0]
    dp2[i] = dp2[i-1] + l[-i-1][1] - l[-i][0] + l[-i-1][0]

ans = max(max(dp1),max(dp2))
tmp = 0
for i in range(n-1):
    for j in range(n-i-1):
        tmp = dp1[i]+dp2[j]-l[i][0]
        if ans < tmp:
            ans = tmp
tmp2 = 0
for i in range(n-1):
    for j in range(n-i-1):
        tmp2 = dp2[i] + dp1[j] - c + l[-i-1][0]
        if ans < tmp2:
            ans = tmp2

if ans > 0:
    print(ans)
else:
    print(0)

Fixed submission:
n,c = map(int,input().split())
l = [[0,0] for _ in range(n)]
dp1 = [0 for _ in range(n)]
dp2 = [0 for _ in range(n)]
mx1 = [0 for _ in range(n)]
mx2 = [0 for _ in range(n)]
for i in range(n):
    l[i] = list(map(int, input().split()))


dp1[0] = l[0][1] - l[0][0]
dp2[0] = l[-1][1] - c + l[-1][0]
tmp = dp1[0]
tmp2 = dp2[0]
mx1[0] = dp1[0]
mx2[0] = dp2[0]
for i in range(1,n):
    dp1[i] = dp1[i-1] + l[i][1] - l[i][0] + l[i-1][0]
    dp2[i] = dp2[i-1] + l[-i-1][1] - l[-i][0] + l[-i-1][0]
    if tmp < dp1[i]:
        mx1[i] = dp1[i]
        tmp = dp1[i]
    else :
        mx1[i] = tmp
    if tmp2 < dp2[i]:
        mx2[i] = dp2[i]
        tmp2 = dp2[i]
    else :
        mx2[i] = tmp2

ans = max(max(dp1),max(dp2))

tmp = [0 for _ in range(n-1)]
tmp2 = [0 for _ in range(n-1)]
for i in range(n-1):
    tmp[i] = dp1[i] + mx2[-i-2] - l[i][0]
    if ans < tmp[i]:
        ans = tmp[i]

for i in range(n-1):
    tmp2[i] = dp2[i] + mx1[-i-2] - (c - l[-i-1][0])
    if ans < tmp2[i]:
        ans = tmp2[i]

if ans > 0:
    print(ans)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
x = [i for i in map(int ,input().split())]
mid = (N-1) // 2
for i in range(N):
    tmp = x[:]
    tmp.remove(x[i])
    tmp.sort()
    print(tmp[mid])

Fixed submission:
N = int(input())
x = [i for i in map(int ,input().split())]
mid = N // 2
tmp = x[:]
tmp.sort()
for i in range(N):
    if tmp[mid] <= x[i]:
        print(tmp[mid-1])
    else:
        print(tmp[mid])
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map (int, input().split())
l = []
for i in range(A,B+1):
    if i < A+K or B - K < i:
        l.append(i)

for i in l:
    print(i)

Fixed submission:
A,B,K = map (int, input().split())
l = []
if A+K > B+1:
    for i in range(A,B+1):
        if i < A+K or B - K < i:
            l.append(i)
else :
    for i in range(A,A+K):
        if i < A+K or B - K < i:
            l.append(i)
if A+K-1 >= B - K+1:
    for i in range(A+K,B+1):
        l.append(i)
else :
    for i in range(B-K+1,B+1):
        l.append(i)


for i in l:
    print(i)
Buggy python submission (verdict: Runtime Error):
X, Y, Z = map(int, input.split())
print(Z, X, Y)

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, C = map(int, input().split())
m = {"x":0, "o":1}
S = list(map(lambda x:m[x], input()))

must = []
k = -1
while 1:
  try:
    if k >= 0:
      S[k] = 1
    k = S.index(1, k+1)
    S[k] = 0
  except:
    break
  j = -C-1
  for i in range(K):
    try:
      j = S.index(1, j+C+1)
    except:
      must.append(k)
      break

for m in must:
  print(m+1)

Fixed submission:
N, K, C = map(int, input().split())
S = input()

must = set()
i = len(S)+C
for j in range(K):
  i = S.rindex("o", 0, i-C)
  must.add(i)
if i<=C or "o" not in S[:i-C]:
  i = -C-1
  for j in range(K):
    i = S.index("o", i+C+1)
    if i in must:
      print(i+1)
Buggy python submission (verdict: Runtime Error):
from functools import *
from collections import *
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
 
M = 10**9+7

@lru_cache(maxsize=None)
def mod_inv(x):
  if x == 1:
    return 1
  return M // x * -mod_inv(M%x) % M

@lru_cache(maxsize=None)
def calc_subtree(v):
  ret = 1
  size = 1
  for child in Edge[v]:
    Edge[child].remove(v)
    r, s = calc_subtree(child)
    ret = ret * r % M
    size += s
  ret = ret * size % M
  return ret, size

ans = {}
def set_ans(v, a):
  ans[v] = a
  for child in Edge[v]:
    n = calc_subtree(child)[1]
    set_ans(child, ans[v] * n * mod_inv(N-n) % M)

N = int(input())
Edge = defaultdict(set)
fact = N
for i in range(1, N):
  fact = fact * i % M
  a, b = map(int, input().split())
  Edge[a].add(b)
  Edge[b].add(a)

set_ans(1, mod_inv(calc_subtree(1)[0]) * fact % M)
for i in range(1, N+1):
  print(ans[i])



Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
from itertools import *

def merge(x,y):
  while 1:
    if x and y and x[0] >= y[0] or (not (x and y)) and x:
      yield x.pop(0)
    else y:
      yield y.pop(0)
    else:
      return

X, Y, A, B, C = map(int, input().split())
P = sorted(map(int, input().split()), reverse=True)
Q = sorted(map(int, input().split()), reverse=True)
R = sorted(map(int, input().split()), reverse=True)

S = sum(islice(merge(P,R), X))
S += sum(islice(merge(Q,R), Y))
print(S)

Fixed submission:
from itertools import *
from heapq import *

X, Y, A, B, C = map(int, input().split())
P = sorted(map(lambda x:-int(x), input().split()))
Q = sorted(map(lambda x:-int(x), input().split()))
R = sorted(map(lambda x:-int(x), input().split()))

S = sum(islice(merge(islice(P, X),islice(Q, Y),R), X+Y))

print(-S)

Buggy python submission (verdict: Runtime Error):
from heapq import *
from itertools import *

class cached_iter(object):
  def __init__(self, it):
    self.it = iter(it)
    self.prev = None
    self._back = False

  def __next__(self):
    if self._back:
      self._back = False
      if self.prev:
        return self.prev
    self.prev = next(self.it)
    return self.prev
        
  def back(self):
    self._back = True

  def __iter__(saelf):
    return self

X, Y, A, B, C = map(int, input().split())
P = sorted(map(lambda x:-int(x), input().split()))
Q = sorted(map(lambda x:-int(x), input().split()))
R = cached_iter(sorted(map(lambda x:-int(x), input().split())))

S = sum(islice(merge(P,R), X))
R.back()
S += sum(islice(merge(Q,R), Y))
print(-S)

Fixed submission:
from itertools import *
from heapq import *

X, Y, A, B, C = map(int, input().split())
P = sorted(map(lambda x:-int(x), input().split()))
Q = sorted(map(lambda x:-int(x), input().split()))
R = sorted(map(lambda x:-int(x), input().split()))

S = sum(islice(merge(islice(P, X),islice(Q, Y),R), X+Y))

print(-S)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input())
print(N*(N-1)//2+M*(M-1)//2)


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

Buggy python submission (verdict: Runtime Error):
N, M = input()
print(N*(N-1)//2+M*(M-1)//2)

Fixed submission:
N, M = map(int, input().split())
print(N*(N-1)//2+M*(M-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

M = 998244353
N, S = map(int, input().split())
A = list(map(int, input().split()))

ans = 0
prev = Counter()
for i, a in enumerate(A, 1):
  curr = Counter({a+s: c for s, c in prev.items() if a+s<=S})
  curr.update({a:i})
  ans = (ans + curr[S]*(N-i+1))%M
  curr.update(prev)
  prev = curr

print(ans)
    

Fixed submission:
M = 998244353
N, S = map(int, input().split())

ans = 0
prev = [0]*S
for i, a in enumerate(map(int, input().split()), 1):
  if a > S:
    continue
  prev[0] = i
  ans = (ans + prev[S-a]*(N-i+1)) % M
  for j, s in enumerate(prev[:S-a], a):
    prev[j] += s
print(ans)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split()))
if H == 1 or W == 1:
  print(1)
else:
  print((H*W+1)//2)

Fixed submission:
H,W=map(int,input().split())
if H == 1 or W == 1:
  print(1)
else:
  print((H*W+1)//2)

Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split()))
if H == 1 or W == 1:
  print(0)
else:
  print((H*W+1)//2)

Fixed submission:
H,W=map(int,input().split())
if H == 1 or W == 1:
  print(1)
else:
  print((H*W+1)//2)
Buggy python submission (verdict: Runtime Error):
def gen_pattern(N, pre=b""):
  for c in range(0x61, max(pre or 0x60)+2):
    pat = pre+c
    if len(pat) == N:
      yield pat.decode()
    else:
      yield from gen_pattern(N, pat)

for pattern in gen_pattern(int(input())):
  print(pattern)


Fixed submission:
from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"
 
def get_gen(a, N):
  for c in s[:s.index(max(a))+2 if a else 1]:
    t = a+c
    if len(t) == N:
      print(t)
    else:
      get_gen(t,N)

get_gen("", N)

Buggy python submission (verdict: Runtime Error):
from string import ascii_lowercase as alph

def gen_pattern(N, pre="", m=-1):
  for i, c in enumerate(alph[:m+2]):
    pat = pre+c
    if len(pattern) == N:
      yield pattern
    else:
      yield from gen_pattern(N, pat, max(i,m))

for pattern in gen_pattern(int(input())):
  print(pattern)


Fixed submission:
from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"
 
def get_gen(a, N):
  for c in s[:s.index(max(a))+2 if a else 1]:
    t = a+c
    if len(t) == N:
      print(t)
    else:
      get_gen(t,N)

get_gen("", N)

Buggy python submission (verdict: Runtime Error):
from string import ascii_lowercase as alph

def gen_pattern(N, pre=""):
  for c in alp[:(ord(max(pre or "\x60"))-0x5f]:
    pattern = pre+c
    if len(pattern) == N:
      yield pattern
    else:
      yield from gen_pattern(N, pattern)

for pattern in gen_pattern(int(input())):
  print(pattern)


Fixed submission:
from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"
 
def get_gen(a, N):
  for c in s[:s.index(max(a))+2 if a else 1]:
    t = a+c
    if len(t) == N:
      print(t)
    else:
      get_gen(t,N)

get_gen("", N)

Buggy python submission (verdict: Runtime Error):
from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"

def get_gen(a, N):
  for c in s[:s.index(max(a))+2]:
    t = a+c
    if len(t) == N:
      print(t)
    else:
      get_gen(t,N)
get_gen("a", N)

Fixed submission:
from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"
 
def get_gen(a, N):
  for c in s[:s.index(max(a))+2 if a else 1]:
    t = a+c
    if len(t) == N:
      print(t)
    else:
      get_gen(t,N)

get_gen("", N)

Buggy python submission (verdict: Runtime Error):
from itertools import product
N=int(input())
s="abcdefghij"
a
ab
abc
abcd
for i in range(N):
  c=s[:i+1]
  for p in product(c,repeat=N-i):
    print(c+"".join(p))

Fixed submission:
from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"
 
def get_gen(a, N):
  for c in s[:s.index(max(a))+2 if a else 1]:
    t = a+c
    if len(t) == N:
      print(t)
    else:
      get_gen(t,N)

get_gen("", N)
Buggy python submission (verdict: Runtime Error):
num = int(input())
print(math.pi * 2 * num)

Fixed submission:
import math
radius = int(input())
c = 2 * math.pi * radius
print("%.2f" % c)
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:
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
d = defaultdict(int)
for i in a:
    d[i]+=1
for i in range(n):
    print(d[i+1])
Buggy python submission (verdict: Runtime Error):
A11, A12, A13 = (int(x) for x in input().split())
A21, A22, A23 = (int(x) for x in input().split())
A31, A32, A33 = (int(x) for x in input().split())

N = int(input())

b_list = list()
for i in range(0, N):
    i = int(input())
    b_list.append(i)

A_list = [A11, A12, A13, A21, A22, A23, A31, A32, A33]

for b in b_list:
    for i in range(0, 9):
        if A_list[i] == b:
            A_list[i] = 0

X, Y, Z = 0, 0, 0
for i in range(0, 3):
    k = 3 * i
    if A_list[k] + A_list[k + 1] + A_list[k + 2] == 0:
        X = X + 1
    elif A_list[i] + A_list[i + 3] + A_list[i + 6] == 0:
        Y = Y + 1
    elif A_list[0] + A_list[4] + A_list[8] == 0:
        Z = Z + 1
    elif A_list[2] + A_list[4] + A_list[6] == 0:
        Z = Z + 1
    else:
        continue

if (X+Y+Z) >= 1:
    print('Yes')
else:
    print('No')

Fixed submission:
N = int(input())

if N%2==0:
    print(int(N/2))
else:
    print(int(N/2 )+ 1)
Buggy python submission (verdict: Time Limit Exceeded):
def is_lunlun(n):
    m = str(n)
    for i in range(1,len(m)):
        if abs(int(m[i]) - int(m[i-1])) > 1:
            return False
    return True

def main():
    K = int(input())
    A = [i for i in range(100000) if is_lunlun(i)]
    B = [int(str(a1)+str(a2)) for a1 in A for a2 in A if is_lunlun(int(str(a1)+str(a2))) and int(str(a1)+str(a2)) < 3234566668]
    B2 = sorted(set(B))
    print(B2[K])

if __name__ == "__main__":
    main()

Fixed submission:
def is_lunlun(n):
    m = str(n)
    for i in range(1,len(m)):
        if abs(int(m[i]) - int(m[i-1])) > 1:
            return False
    return True

def main():
    K = int(input())
    A = [format(str(i),"0>5") for i in range(100000) if is_lunlun(i)]
    B = [int(a1+a2) for a1 in A for a2 in A if int(a1+a2) < 3234566668 and is_lunlun(int(a1+a2))]
    B2 = sorted(set(B))
    print(B2[K])

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    N,A,B = map(int,input().split())
    a = N//(A+B)
    b = N % (a * (A+B))
    print(a*A+b)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N,A,B = map(int,input().split())
    a = N//(A+B)
    b = N - (a * (A+B))
    if b >= A:
        print(a*A+A)
    elif b < A:
        print(a*A+b)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from collections import deque
    S = input()
    Sd = deque(list(S))
    Q = int(input())
    Query = [input().split() for i in range(Q)]
    for q in Query:
        if q[0] == "1":
            Sd.reverse()
        elif q[0] == "2":
            if q[1] == "1":
                Sd.appendleft(q[2])
            elif q[1] == "2":
                Sd.append(q[2])

    print("".join(Sd))

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    from collections import deque
    S = input()
    Sd = deque(list(S))
    Q = int(input())
    Query = [input().split() for i in range(Q)]
    flag = 0
    for q in Query:
        if q[0] == "1":
            flag += 1
        elif q[0] == "2":
            if q[1] == "1":
                if flag % 2 == 1:
                    Sd.append(q[2])
                elif flag % 2 == 0:
                    Sd.appendleft(q[2])
            elif q[1] == "2":
                if flag % 2 == 1:
                    Sd.appendleft(q[2])
                elif flag % 2 == 0:
                    Sd.append(q[2])

    if flag % 2 == 1:
        Sd.reverse()
        print("".join(Sd))
    elif flag % 2 == 0:
        print("".join(Sd))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    input = sys.stdin.readline
    N = int(input())
    S = [input().strip() for i in range(N)]
    S.sort()
    set_S = set(S)
    cnt = 0
    ll = []
    for s in set_S:
        s_num = S.count(s)
        if cnt < s_num:
            cnt = s_num
            ll = [s]
        elif cnt == s_num:
            ll.append(s)

    ll.sort()
    print("\n".join(ll))

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    import sys
    import collections
    input = sys.stdin.readline
    N = int(input())
    S = [input() for i in range(N)]
    c = collections.Counter(S)
    max_num = c.most_common(1)[0][1]
    ss = [cc[0] for cc in c.most_common() if cc[1] == max_num]
    ss.sort()
    for s in ss:
        print(s,end="")

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    input = sys.stdin.readline
    N = int(input())
    S = [input() for i in range(N)]
    set_S = list(set(S))
    cnt = 0
    ll = []
    for s in set_S:
        s_num = S.count(s)
        if cnt < s_num:
            cnt = s_num
            ll = [s]
        elif cnt == s_num:
            ll.append(s)
        elif cnt > s_num:
            pass

    ll.sort()
    for l in ll:
        print(l,end="")


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    import sys
    import collections
    input = sys.stdin.readline
    N = int(input())
    S = [input() for i in range(N)]
    c = collections.Counter(S)
    max_num = c.most_common(1)[0][1]
    ss = [cc[0] for cc in c.most_common() if cc[1] == max_num]
    ss.sort()
    for s in ss:
        print(s,end="")

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    S = [input() for i in range(N)]
    set_S = set(S)
    cnt = 0
    ll = []
    for s in set_S:
        s_num = S.count(s)
        if cnt < s_num:
            cnt = s_num
            ll = [s]
        elif cnt == s_num:
            ll.append(s)
        elif cnt > s_num:
            pass

    lll = sorted(ll)
    for l in lll:
        print(l)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    import sys
    import collections
    input = sys.stdin.readline
    N = int(input())
    S = [input() for i in range(N)]
    c = collections.Counter(S)
    max_num = c.most_common(1)[0][1]
    ss = [cc[0] for cc in c.most_common() if cc[1] == max_num]
    ss.sort()
    for s in ss:
        print(s,end="")

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N,K = map(int, input().split())
    pi = list(map(int, input().split()))
    max_num = 0
    new_pi = [0] * N

    for i in range(N):
        new_pi[i] += (1+pi[i])/2

    for i in range(N):
        s = sum(new_pi[i:i+K])
        if s > max_num:
            max_num = s

    print(max_num)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N,K = map(int, input().split())
    pi = list(map(int, input().split()))
    max_num = 0
    new_pi = [0] * N
    sum_new_pi = [0] * (N+1)

    for i in range(N):
        new_pi[i] += (1+pi[i])/2

    for i in range(N):
        sum_new_pi[i+1] = sum_new_pi[i] + new_pi[i]

    for i in range(N):
        if i+K > N:
            break
        s = sum_new_pi[i+K] - sum_new_pi[i]
        if s > max_num:
            max_num = s

    print(max_num)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N,K = map(int, input().split())
    pi = list(map(int, input().split()))
    max_num = 0

    for i in range(N):
        s = 0
        if i+K > N:
            break
        for j in range(K):
            s += (1+pi[i+j])/2
        if s > max_num:
            max_num = s

    print(max_num)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N,K = map(int, input().split())
    pi = list(map(int, input().split()))
    max_num = 0
    new_pi = [0] * N
    sum_new_pi = [0] * (N+1)

    for i in range(N):
        new_pi[i] += (1+pi[i])/2

    for i in range(N):
        sum_new_pi[i+1] = sum_new_pi[i] + new_pi[i]

    for i in range(N):
        if i+K > N:
            break
        s = sum_new_pi[i+K] - sum_new_pi[i]
        if s > max_num:
            max_num = s

    print(max_num)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    P_list = list(map(int,input().split()))
    i_num = 0
    min_P = P_list[0]
    for p in P_list:
        if p <= min_P:
            min_P = p
            i_num += 1
    print(i_num)

if __name__ == __main__:
    main()

Fixed submission:
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
min_P = P_list[0]
for p in P_list:
    if p <= min_P:
        min_P = p
        i_num += 1
print(i_num)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    N = int(input())
    input_2 = sys.stdin.readline
    P_list = list(map(int,input_2().split()))
    i_num = 0
    for i in range(N):
        if P_list[i] <= min(P_list[:i+1]):
            i_num += 1
    print(i_num)

if __name__ == "__main__":
    main()

Fixed submission:
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
min_P = P_list[0]
for p in P_list:
    if p <= min_P:
        min_P = p
        i_num += 1
print(i_num)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
for i in range(N):
    if P_list[i] <= min(P_list[:i+1]):
        i_num += 1
print(i_num)

Fixed submission:
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
min_P = P_list[0]
for p in P_list:
    if p <= min_P:
        min_P = p
        i_num += 1
print(i_num)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
for i in range(N):
    if P_list[i] <= min(P_list[:i+1]):
        i_num += 1
print(i_num)

Fixed submission:
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
min_P = P_list[0]
for p in P_list:
    if p <= min_P:
        min_P = p
        i_num += 1
print(i_num)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
for i in range(N):
    now_num = P_list[i]
    new_list = P_list[0:i+1]
    if now_num <= min(new_list):
        i_num += 1
    elif now_num > min(new_list):
        pass
print(i_num)

Fixed submission:
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
min_P = P_list[0]
for p in P_list:
    if p <= min_P:
        min_P = p
        i_num += 1
print(i_num)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
for i in range(N):
    now_num = P_list[i]
    new_list = P_list[0:i+1]
    if now_num <= min(new_list):
        i_num += 1
    elif now_num > min(new_list):
        pass
print(i_num)


Fixed submission:
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
min_P = P_list[0]
for p in P_list:
    if p <= min_P:
        min_P = p
        i_num += 1
print(i_num)
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())
mas = [list(input()) for i in range(H)]
new_mas = [row for row in mas if "#" in row:]
new_mas2 = [column for column in list(zip(*new_mas)) if "#" in column]
for i in list(zip(*new_mas2)):
    for j in i:
        print(j,end="")
    print()


Fixed submission:
H,W = map(int,input().split())
mas = [list(input()) for i in range(H)]
new_mas = []
new_mas2 = []
for row in mas:
    if "#" in row:
        new_mas.append(row)
    elif "#" not in row:
        continue

for column in list(zip(*new_mas)):
    if "#" in column:
        new_mas2.append(column)
    elif "#" not in column:
        continue

for i in list(zip(*new_mas2)):
    for j in i:
        print(j,end="")
    print()