Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, (input().split())))

distance = lambda Xi, P: (Xi - P) ** 2

X_max = max(X)

answer = None
for P in range(1, X_max + 1):
    total = 0
    for Xi in X:
        total += distance(Xi, P)
    answer = min(total, answer) if answer is not None else total

print(answer)


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

distance = lambda Xi, P: (Xi - P) ** 2

X_max = max(X)

answer = 99999999999
for P in range(1, X_max + 1):
    total = 0
    for Xi in X:
        total += distance(Xi, P)
    answer = min(total, answer)

print(answer)
Buggy python submission (verdict: Runtime Error):
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = A2 + ' ' + B2

print(output)


Fixed submission:
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = "{} {}".format(A2, B2)

print(output)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

table = {}
answer = 'Yes'
for i in range(0, len(A) + 1):
# for(let i = 0; i < A.length; i++):
    Ai = A[i]
    count = table.get(Ai) + 1 if table.get(Ai) else 1
    table[Ai] = count

    if table.get(Ai) >= 2:
        answer = 'No'
        break

print(answer)


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

table = {}
answer = 'YES'
for i in range(0, len(A)):
    Ai = A[i]
    count = table.get(Ai) + 1 if table.get(Ai) else 1
    table[Ai] = count

    if table.get(Ai) >= 2:
        answer = 'NO'
        break

print(answer)
Buggy python submission (verdict: Runtime Error):
inputted = list(map(int, input().split()))
K = int(input())
X = int(input())

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);


Fixed submission:
inputted = list(map(int, input().split()))
K = inputted[0]
X = inputted[1]

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);

Buggy python submission (verdict: Runtime Error):
K = int(input())
X = int(input())

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);


Fixed submission:
inputted = list(map(int, input().split()))
K = inputted[0]
X = inputted[1]

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);
Buggy python submission (verdict: Runtime Error):
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
K = inputted[2]

A2 = max([0, A - K])
B2 = max([0, B - max([0, K - A]))

answer = '{} {}'.format(A2, B2)

print(answer)


Fixed submission:
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
K = inputted[2]

A2 = max([0, A - K])
B2 = max([0, B - max([0, K - A])])

answer = '{} {}'.format(A2, B2)

print(answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
inputted = list(map(int, input().split()))
S = inputted[0]
T = inputted[1]

answer = ''
for s, t in zip(S, T):
    answer += s + t

answer = ''.join([s + t for s, t in zip(S, T)])

print(answer)

Fixed submission:
N = int(input())
inputted = input().split()
S = inputted[0]
T = inputted[1]

answer = ''
for s, t in zip(S, T):
    answer += s + t

answer = ''.join([s + t for s, t in zip(S, T)])

print(answer)

Buggy python submission (verdict: Runtime Error):
N = int(input())
inputted = list(map(int, input()))
S = inputted[0]
T = inputted[1]

answer = ''
for s, t in zip(S, T):
    answer += s + t

answer = ''.join([s + t for s, t in zip(S, T)])

print(answer)

Fixed submission:
N = int(input())
inputted = input().split()
S = inputted[0]
T = inputted[1]

answer = ''
for s, t in zip(S, T):
    answer += s + t

answer = ''.join([s + t for s, t in zip(S, T)])

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
A, B = list(map(int, input().split()))

answer = max(A, B)
while True:
    if answer % A == 0 and answer % B  == 0:
        break
    answer += 1

print(answer)

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

multiply = 1
while True:
    if A * multiply % B  == 0:
        break
    multiply += 1

answer = A * multiply

print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
A, B = list(map(int, input().split()))

answer = max(A, B)
while True:
    if answer % A == 0 and answer % B  == 0:
        break
    answer += 1

print(answer)

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

multiply = 1
while True:
    if A * multiply % B  == 0:
        break
    multiply += 1

answer = A * multiply

print(answer)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

remain = max(0, A - B * 2)

print(remain)


Fixed submission:
data = input().split()
A = int(data[0])
B = int(data[1])

remain = max(0, A - B * 2)

print(remain)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())

answer = [0] * len(A)
for i, Ai, in enumerate(A):
    answer[Ai - 1] = str(i + 1)
answer = ' '.join(answer)

print(answer)


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

answer = [0] * N
for i, Ai, in enumerate(A):
    answer[Ai - 1] = str(i + 1)
answer = ' '.join(answer)

print(answer)
Buggy python submission (verdict: Runtime Error):
a = inptu()
s = input()

answer = s if a >= 3200 else 'red'

print(answer)


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

answer = s if a >= 3200 else 'red'

print(answer)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = input()

answer = max(
    A + B,
    A - B,
    A * B,
)

print(answer)


Fixed submission:
data = input()
data = data.split(' ')

A = int(data[0])
B = int(data[1])

answer = max(
    A + B,
    A - B,
    A * B,
)

print(answer)
Buggy python submission (verdict: Runtime Error):
import math

inputted = list(map(int, input()))
N = inputted[0]
D = inputted[1]

monitor = (D + 1) * 2
answer = math.ceil(N / monitor)

print(answer)


Fixed submission:
import math

inputted = list(map(int, input().split()))
N = inputted[0]
D = inputted[1]

monitor = D * 2 + 1
answer = math.ceil(N / monitor)

print(answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]

is_there_tow_maximum = A.count(maxiuam) >= 2
if is_there_tow_maximum:
    answer = (str(maxiuam) + "\n") * N
    print(answer)
    exit()

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = [second if Ai == maxiuam else maxiuam for Ai in A)]
answer = "\n".join(map(str, answer))

print(answer)


Fixed submission:
import collections


N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]
is_there_tow_maximum = A.count(maxiuam) >= 2

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = []
for Ai in A:
    if is_there_tow_maximum:
        answer.append(maxiuam)
    elif Ai == maxiuam:
        answer.append(second)
    else:
        answer.append(maxiuam)
answer = "\n".join(map(str, answer))

print(answer)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]

is_there_tow_maximum = A.count(maxiuam) >= 2
if is_there_tow_maximum:
    answer = (str(maxiuam) + "\n") * N
    print(answer)
    exit()

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = answer.append(second if Ai == maxiuam else maxiuam for Ai in A)
answer = "\n".join(map(str, answer))

print(answer)


Fixed submission:
import collections


N = int(input())
A = [int(input()) for i in range(N)]


sorted_A = list(reversed(sorted(A)))

maxiuam = sorted_A[0]
is_there_tow_maximum = A.count(maxiuam) >= 2

second = None
for Ai in sorted_A:
    if Ai < maxiuam:
        second = Ai
        break

answer = []
for Ai in A:
    if is_there_tow_maximum:
        answer.append(maxiuam)
    elif Ai == maxiuam:
        answer.append(second)
    else:
        answer.append(maxiuam)
answer = "\n".join(map(str, answer))

print(answer)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
W = list(map(int, input().split()))


def search(start, end, i, W):
    S1 = sum(W[0:i + 1])
    S2 = sum(W[i + 1:len(W)])

    next_i = math.floor(i / 2) if S1 >= S2 else math.floor((i + end) / 2)

    if S1 == S2: return i
    if S1 > S2:
        next_start = start
        next_end = i
    else:
        next_start = i + 1
        next_end = end
    
    # print(start, next_start, end, next_end, i, next_i, S1, S2)
    if next_start == end: return next_start
    if next_end == start: return next_end
    
    return search(next_start, next_end, next_i, W)


i = search(0, len(W) - 1, math.floor((len(W) - 1) / 2), W)

S1 = sum(W[0:i + 1])
S2 = sum(W[i + 1:len(W)])
diff = abs(S2 - S1)

print(diff)


Fixed submission:
inputted = list(map(int, input().split()))
AB = BA = inputted[0]
BC = CB = inputted[1]
AC = CA = inputted[2]

answer = min([
    AB + BC,
    AC + CB,
    BA + AC,
    BC + CA,
    CA + AB,
    CB + BA,
])

print(answer)
Buggy python submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ceil = lambda number: math.ceil(number / 10) * 10
ceiled_A = ceil(A)
ceiled_B = ceil(B)
ceiled_C = ceil(C)
ceiled_D = ceil(D)
ceiled_E = ceil(E)

maximum_diff = None
for minitues in [A, B, C, D, E]:
    ceiled = ceil(minitues)
    diff = ceiled - minitues
    if diff == 0: continue

    if maximum_diff is None or diff > maximum_diff:
        maximum_diff = diff

answer = ceiled_A + ceiled_B + ceiled_C + ceiled_D + ceiled_E - maximum_diff
    
print(answer)


Fixed submission:
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

ceil = lambda number: math.ceil(number / 10) * 10
ceiled_A = ceil(A)
ceiled_B = ceil(B)
ceiled_C = ceil(C)
ceiled_D = ceil(D)
ceiled_E = ceil(E)

maximum_diff = 0
for minitues in [A, B, C, D, E]:
    ceiled = ceil(minitues)
    diff = ceiled - minitues
    if diff == 0: continue

    if maximum_diff is None or diff > maximum_diff:
        maximum_diff = diff

answer = ceiled_A + ceiled_B + ceiled_C + ceiled_D + ceiled_E - maximum_diff
    
print(answer)
Buggy python submission (verdict: Runtime Error):
S = input()
S = [Si for Si in S]

i = len(S) - 2
number_of_deleted_qube = 0
while i >= 0 and len(S) >= 2:
    current = S[i]
    right = S[i + 1]

    if current != right:
        del S[i + 1]
        del S[i]
        number_of_deleted_qube += 2

    i -= 1

print(number_of_deleted_qube)


Fixed submission:
S = input()
S = [Si for Si in S]

i = len(S) - 2
number_of_deleted_qube = 0
while i >= 0 and len(S) >= 2:
    if i >= len(S) - 1:
        i -= 1
        continue

    current = S[i]
    right = S[i + 1]

    if current != right:
        del S[i + 1]
        del S[i]
        number_of_deleted_qube += 2

    i -= 1

print(number_of_deleted_qube)

Buggy python submission (verdict: Runtime Error):
S = input()
S = [Si for Si in S]

i = len(S) - 2
number_of_deleted_qube = 0
while i >= 0:
    current = S[i]
    right = S[i + 1]

    if current != right:
        del S[i + 1]
        del S[i]
        number_of_deleted_qube += 2

    i -= 1

print(number_of_deleted_qube)


Fixed submission:
S = input()
S = [Si for Si in S]

i = len(S) - 2
number_of_deleted_qube = 0
while i >= 0 and len(S) >= 2:
    if i >= len(S) - 1:
        i -= 1
        continue

    current = S[i]
    right = S[i + 1]

    if current != right:
        del S[i + 1]
        del S[i]
        number_of_deleted_qube += 2

    i -= 1

print(number_of_deleted_qube)
Buggy python submission (verdict: Runtime Error):
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]
# print(N, xyh)

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        candidate = None
        for x, y, h in xyh:
            if h == 0: continue
            dx = abs(x - cx)
            dy = abs(y - cy)
            candidate = dx + dy + h 
            break
        
        found = True
        for x, y, h in xyh:
            if h == 0: continue
            if h + abs(x - cx) + abs(y - cy) != candidate:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)


Fixed submission:
N = int(input())

if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    add = A + B
    print(add)
Buggy python submission (verdict: Runtime Error):
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]
# print(N, xyh)

candidate = lambda xyh, cx, cy: abs(xyh[0] - cx) + abs(xyh[1] - cy) + xyh[2]

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        found = True
        candidates = [candidate(xyhi, cx, cy) for xyhi in xyh]

        found = True
        height = None
        for candidate in candidates:
            if candidate < 0: continue
            if height is None:
                height = candidate
                continue
            if candidate != height:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)


Fixed submission:
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]
# print(N, xyh)

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        candidate = 0
        for x, y, h in xyh:
            if h == 0: continue
            dx = abs(x - cx)
            dy = abs(y - cy)
            candidate = dx + dy + h 
            break

        found = True
        for x, y, h in xyh:
            _h = candidate - abs(x - cx) - abs(y - cy)
            if h == 0 and _h <= 0: continue
            if not h == _h:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)

Buggy python submission (verdict: Runtime Error):
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]
# print(N, xyh)

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        height = abs(xyh[0][0] - cx) + abs(xyh[0][1] - cy) + xyh[0][2]
        foo = [(abs(x - cx) + abs(y - cy) + h == height or (abs(x - cx) + abs(y - cy) + h == 0) for x, y, h in xyh]
        found = all(foo)
        if found: break
    if found: break
print(cx, cy, height)


Fixed submission:
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]
# print(N, xyh)

height = None
found = False
for cx in range(0, 101):
    for cy in range(0, 101):
        candidate = 0
        for x, y, h in xyh:
            if h == 0: continue
            dx = abs(x - cx)
            dy = abs(y - cy)
            candidate = dx + dy + h 
            break

        found = True
        for x, y, h in xyh:
            _h = candidate - abs(x - cx) - abs(y - cy)
            if h == 0 and _h <= 0: continue
            if not h == _h:
                found = False
                break
        
        if found is True: break
    if found is True: break
height = candidate if candidate is not None else 0

print(cx, cy, height)
Buggy python submission (verdict: Runtime Error):
from collections import Counter


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

v_odd = []
v_even = []
for index in range(len(v)):
    i = index + 1
    if i % 2 == 0:
        v_even.append(v[index])
    else:
        v_odd.append(v[index])
# print(v_odd)
# print(v_even)
# print(Counter(v_odd).most_common())
# print(Counter(v_even).most_common())

if Counter(v_odd).most_common()[0][1] != Counter(v_even).most_common()[0][1]:
    number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]
    number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]
else:
    if Counter(v_odd).most_common()[0][1] >= Counter(v_even).most_common()[0][1]:
        number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]
        number_of_rewrites += len(v_even) - Counter(v_even).most_common()[1][1]
    else:
        number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[1][1]
        number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]


print(number_of_rewrites)


Fixed submission:
from collections import Counter


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

v_odd = []
v_even = []
for index in range(len(v)):
    i = index + 1
    if i % 2 == 0:
        v_even.append(v[index])
    else:
        v_odd.append(v[index])
# print(v_odd)
# print(v_even)
# print(Counter(v_odd).most_common())
# print(Counter(v_even).most_common())

if Counter(v_odd).most_common()[0][0] != Counter(v_even).most_common()[0][0]:
    number_of_rewrites = len(v_odd) - Counter(v_odd).most_common()[0][1]
    number_of_rewrites += len(v_even) - Counter(v_even).most_common()[0][1]
else:
    odd_1st = Counter(v_odd).most_common()[0][1]
    even_1st = Counter(v_even).most_common()[0][1]
    odd_2nd = Counter(v_odd).most_common()[1][1] if len(Counter(v_odd).most_common()) >= 2 else 0
    even_2nd = Counter(v_even).most_common()[1][1] if len(Counter(v_even).most_common()) >= 2 else 0

    number_of_rewrites = min(
        len(v_odd) - odd_1st + len(v_even) - even_2nd,
        len(v_odd) - odd_2nd + len(v_even) - even_1st,
    )

print(number_of_rewrites)
Buggy python submission (verdict: Runtime Error):
import math


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd_value = math.gcd(x[0], x[0])
for i in range(len(x)):
    gcd_value = math.gcd(gcd_value, x[i])
    # print(gcd)
print(gcd_value)


Fixed submission:
import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd_value = fractions.gcd(x[0], x[0])
for i in range(len(x)):
    gcd_value = abs(fractions.gcd(gcd_value, x[i]))
    # print(gcd)
print(gcd_value)

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


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd = math.gcd(x[0], x[0])
for i in range(len(x)):
    gcd = math.gcd(gcd, x[i])
    # print(gcd)
print(gcd)


Fixed submission:
import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd_value = fractions.gcd(x[0], x[0])
for i in range(len(x)):
    gcd_value = abs(fractions.gcd(gcd_value, x[i]))
    # print(gcd)
print(gcd_value)

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


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd = math.gcd(x[0], x[0])
for i in range(len(x)):
    gcd = math.gcd(gcd, x[i])
    # print(gcd)
print(gcd)


Fixed submission:
import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
# print(N, X, x)

minimum = x[0]
for i in range(len(x)):
    x[i] = x[i] - X
    minimum = min(x[i], minimum)
# print(x, minimum)

gcd_value = fractions.gcd(x[0], x[0])
for i in range(len(x)):
    gcd_value = abs(fractions.gcd(gcd_value, x[i]))
    # print(gcd)
print(gcd_value)
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())

answer = S[1]
print(answer)


Fixed submission:
S = input()
K = int(input())

are_all_one = True
for i in range(len(S)):
    if S[i] != '1':
        are_all_one = False
        break

nth = i + 1
if are_all_one or K < nth:
    print(1)
    exit()

answer = S[i]
print(answer)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int, input().split()))
# print(N, A)

_A = [A[i] - (i + 1) for i in range(len(A))]
_A.sort()
median = _A[math.ceil(len(A) / 2)]

sadness = 0
for i in range(len(A)):
    sadness += abs(A[i] - (i + 1 + median))

print(sadness)


Fixed submission:
import math

N = int(input())
A = list(map(int, input().split()))
# print(N, A)

_A = []
for i in range(len(A)):
    _A.append(A[i] - (i + 1))
_A.sort()
median = _A[math.floor(len(A) / 2)]

sadness = 0
for i in range(len(A)):
    sadness += abs(A[i] - (i + 1 + median))

print(sadness)

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

N = int(input())
A = list(map(int, input().split()))
# print(N, A)

_A = [] * len(A)
for i in range(len(A)):
    _A[i] -= (i + 1)
_A.sort()
median = _A[len(A) / 2]

sadness = 0
for i in range(len(A)):
    sadness += abs(A[i] - (i + 1 + median))

print(sadness)


Fixed submission:
import math

N = int(input())
A = list(map(int, input().split()))
# print(N, A)

_A = []
for i in range(len(A)):
    _A.append(A[i] - (i + 1))
_A.sort()
median = _A[math.floor(len(A) / 2)]

sadness = 0
for i in range(len(A)):
    sadness += abs(A[i] - (i + 1 + median))

print(sadness)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
#P = [int(i) for i in input().split()]
P = list(map(int, input().split()))
P_min = min(P)

count = 1
for i in range(N-1):
    if P[i+1] == P_min:
        count+=1
        break
    if min(P[:i+1]) > P[i+1]:
        count+=1

print(count)

Fixed submission:
# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(input())
P = list(map(int, input().split()))
c = 10**9
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = [int(i) for i in input().split()]
P_min = min(P)

count = 1
for i in range(N-1):
    if P[i+1] == P_min:
        count+=1
        break
    if min(P[:i+1]) > P[i+1]:
        count+=1

print(count)

Fixed submission:
# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(input())
P = list(map(int, input().split()))
c = 10**9
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
P = [int(i) for i in input().split()]
min = min(P)

count = 1
for i in range(N-1):
    if P[i+1] == min:
        break
    if min(P[:i+1]) > P[i+1]:
        count+=1
    
print(count)

Fixed submission:
# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(input())
P = list(map(int, input().split()))
c = 10**9
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = [int(i) for i in input().split()]

count = 1
for i in range(N-1):
    if min(P[:i+1]) > P[i+1]:
        count+=1
print(count)

Fixed submission:
# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(input())
P = list(map(int, input().split()))
c = 10**9
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))

Fixed submission:
A, B = map(int, input().split())

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

#最小公倍数
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(A,B))