Problem:


Score : 300 points

Problem Statement

Given is a permutation P_1, \ldots, P_N of 1, \ldots, N.
Find the number of integers i (1 \leq i \leq N) that satisfy the following condition:  

For any integer j (1 \leq j \leq i), P_i \leq P_j.

Constraints

1 \leq N \leq 2 \times 10^5

P_1, \ldots, P_N is a permutation of 1, \ldots, N.  

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
P_1 ... P_N

Output

Print the number of integers i that satisfy the condition.

Sample Input 1

5
4 2 5 1 3

Sample Output 1

3

i=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.

Similarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.

Sample Input 2

4
4 3 2 1

Sample Output 2

4

All integers i (1 \leq i \leq N) satisfy the condition.

Sample Input 3

6
1 2 3 4 5 6

Sample Output 3

1

Only i=1 satisfies the condition.

Sample Input 4

8
5 7 4 2 6 8 1 3

Sample Output 4

4

Sample Input 5

1
1

Sample Output 5

1



Sample input:
5
4 2 5 1 3


Sample output:
3

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
P = list(map(int,input().split()))
list = [True]*N
for j in range(N):
    for i in range(j+1,N):
        if P[i] <= P[j]:
            None
        else:
            list[i] = False
print(list.count(True))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

count = 0
for i in range(n):
    flag = 0
    for j in range(i, -1, -1):
        if p[i] > p[j]:
            break
        else:
            flag += 1
    if flag == i+1:
        count += 1
        
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
p=list(map(int,input().split()))
n=0
m=[]
for i in range(N):
    m.append(0)

for i in range(N):
    for j in range(i):
        if p[i]<=p[j]:
            m[i]+=1

for i in range(N):
    if m[i]==i:
        n+=1
print(n)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p_lists = list(map(int, input().split()))

ans = 0

for i in range(n):
    is_true = 1
    for j in range(0,i):
        if p_lists[i] > p_lists[j]:
            is_true = 0
    if is_true == 1:
        ans = ans + 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = list(map(int, input().split()))

lst2 = []
i = 0
for _ in range(n):
    now = lst[_] 
    lst2.append(now)
    
    if now == min(lst2):
        i += 1
print(i)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p = list(map(int, input().split()))

count=0
for i in range(n):
  flag = True
  for j in range(i+1):
    if p[i] <= p[j]:
      pass
    else:
      flag = False
  if flag:
    count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import bisect
n = int(input())
p = list(map(int,input().split()))
l = []
c = 0
for i in p:
  ind = bisect.bisect_left(l,i)
  l.insert(ind, i)
  if ind == 0:
    c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

a = 1
qs = [ps[0]]
for i in range(1,n):
    if min(qs) >= ps[i]:
        a += 1
    qs.append(ps[i])

print(a)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = input().split()
p = [int(i) for i in p]

c = 0
for i in range(n):
    for j in range(i):
        if p[i] <= p[j]:
            continue
        else:
            break
    else:
        c += 1

print(c)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list1=list(map(int,input().split()))
ln=[list1[0]]
for i in list1:
    if min(ln)>=i:
        ln.append(i)
print(len(ln)-1)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
Min = min(p)
cnt = 0
for i in range(n):
    l = p[:i+1]
    if min(l) == p[i]:
        cnt += 1
        if p[i] == Min:
            break
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    ps = list(map(int, input().split()))
    li = []
    ans = 0
    for i in ps:
        li.append(i)
        if sorted(li)[0] >= i:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
per = [0] + [int(i) for i in input().split()]
res = 0
for i in range(1, N+1):
  flag = True
  for j in range(1, i+1):
    if per[i] > per[j]: 
      flag = False
      break
  
  if flag: res += 1
print(res)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
  if i==0:
    cnt+=1
  else:
    if p[i]<=min(p[0:i]):
      cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
n_list = list(map(int, input().split()))
count = 0
for i in range(n):
    test = n_list[:i+1]
    if min(test) == n_list[i]:
        count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
    a = p[:i + 1]
    
    if min(a) >= p[i]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
line = input().split(" ")

i = 0
counter = 0
for p_i in line:
    p_i = int(p_i)

    j = 0
    check = True
    for p_j in line:
        p_j = int(p_j)
        if(j > i):
            break    
        if(p_j < p_i):
            check = False
            break
        j += 1
    
    if(check):
        counter += 1

    i += 1

print(counter)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P_i = list(map(int, input().split()))

total = 0


for i in range(N):
    if P_i[i] <= min(P_i[0:i + 1]) :
        total += 1


print(total)

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    p = list(map(int, input().split()))
    count = 0
    for i in range(n):
        flg = True
        for j in range(i):
            if p[i] > p[j]:
                flg = False
        if flg:
            count += 1

    print(count)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
c = 0
i = 0
while i < n:
  new = p[0:i+1]
  if p[i] == min(new):
    c = c + 1
  i = i + 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
li=list(map(int,input().split()))
ans=0

for i in range(n):
    for j in range(i+1):
        if li[i]>li[j]:
            ans+=1
            break

print(n-ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
num = list(map(int,input().split()))
cnt = 0
flag = False
for i in range(N):
	for j in range(i):
		if num[i] > num[j]:
			flag = True
			break
	if(flag == False):
		cnt+=1
	flag = False
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
cnt=1
for i in range(1,n):
    x=p[i]
    if x<=min(p[:p.index(x)]):
        cnt+=1
    else: continue
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 0


for i in range(N):
  flag = 1
  for j in range(i):
    if P[i] > P[j]:
      flag = 0
  if flag == 1:
    ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(x) for x in input().split()]
ans = 0
m = 0
for i in range(N):
    for j in range(m, i):
        if P[i] > P[j]:
            m = j
            break
    else:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int, input().split()))
ans=0
for i in range(n):
    buf=0
    for j in range(i+1):
        if p[j]>=p[i]:
            buf+=1
    if buf==i+1:
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
s=[]
ans=0
for i in range(n):
    s.append(p[i])
    if min(s)==p[i]:
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

ans = 0
for i in range(1,N+1):
  for j in range(1,i+1):
    if P[j-1]<P[i-1]:
      break
  else:
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
pList = list(map(int,input().split()))

count = 1
for i in range(1,n-1):
  sp = sorted(pList[:i])
  if sp[0] >= pList[i]:
    count += 1

if len(pList) != 1:
    ls = sorted(pList[:-1])
    if ls[0] >= pList[-1]:
      count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

i_count = 0
flag = True
for i in range(N):
  flag = True
  for j in range(i):
    if P[i] > P[j]:
      flag = False
      break

  if flag:
    i_count+=1

print(i_count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
m = min(A)
cnt = 0
for i in range(N):
  if A[N-1-i] == m and i != N - 1:
    m = min(A[:N-1-i])
    cnt += 1
  if i == N - 1:
    cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
num_list = [int(i) for i in stdin.readline().rstrip().split()]
output = 0
for n in range(0, N):
    now_value = num_list[n]
    over_list = [i for i in num_list[:n] if i > now_value]
    if len(over_list) == len(num_list[:n]):
        output += 1
print(output)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p_li = list(map(int, input().split()))

answer = 0
for i in range(len(p_li)):
    count_flag = True
    for j in range(i):
        if p_li[i] <= p_li[j]:
            continue
        else:
            count_flag = False
            break
    if count_flag:
        answer += 1

print(answer)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

count = 1

for i in range(1, len(P)):
    if min(P[:i]) >= P[i]:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
P = list(map(int,input().split(" ")))
ans = 0
for i in range(n):
    tmp = min(P[:i+1])
    if tmp == P[i]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [i for i in map(int, input().split())]

count = 0
for i in range(N):
	flag = 1
	for j in range(i):
		if P[i] <= P[j]:
			flag = 1
		else:
			flag = -1
			break

	if flag == 1:
		count += 1

			
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
p_list = [True for i in range(n)]
for i in range(1,n):
    for j in range(i):
        if p[i] > p[j]:
            p_list[i] = False
            break
print(p_list.count(True))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1,N+1):
    temp = p[i-1]
    for j in range(i):
        if temp <= p[j]:
            pass
        else:
            break
    else:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

ans = 1 #i=1は絶対満たす
for i in range(1,n):
    tmp = 1
    for j in range(0,i):
        if p[i] > p[j]:
            tmp = 0
            break
    ans += tmp
print(ans)

Submission status: Time Limit Exceeded

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

    ans = 0
    for i in range(N):
        for j in reversed(range(0, i)):
            if P[j] < P[i]:
                break
        else:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
L = list(map(int,input().split()))
ans = 0
for i in range(N):
    Pi = L[i]
    tes = True
    for j in range(i + 1):
        if Pi > L[j]:
            tes = False
    if tes:
        ans +=1 
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
 
value = 1
 
ac = [P[i] for i in range(1, N) if P[i] <= min(P[:i])]
 
value += len(ac)
 
print(value)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
count = 0
for i in range(N):
    if A[i] == min(A[0:i+1]):
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(a) for a in input().split()]

ans = 1
done = [p[0]]
for i in range(1, n):
  if min(done) < p[i]:
    pass
  else:
    ans += 1
  done.append(p[i])

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())
P = np.array(list(map(int, input().split())))

ans = 0
for i in range(N):
    for j in range(i):
        if P[j] < P[i]:
            break
    else:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))

ans = 0
for i in range(n):
    if min(l[0:i + 1]) == l[i]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    p_list = list(map(int, input().split()))
    count = 1
    for i in range(1, len(p_list)):
      flag = True
      for j in range(i):
          if p_list[i] > p_list[j]:
              flag = False
              break

      if flag:
          count += 1

    print(count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(x) for x in input().split()]

ans = 0

for i in range(n):
    baes = p[i]
    flag = True
    for j in range(i):
        if p[i] > p[j]:
            flag = False
            break

    if flag:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
cnt = 0

for i in range(len(P)):
  if P[i] == min(P[:i+1]):
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
def func():
    return

n = int(input())
# s = input()
# a, b = map(int, input().split())
p = list(map(int, input().split()))
# a = input().split()

cnt = 0
for i in range(n):
    if min(p[:i+1]) == p[i]:
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

count = 1
result = 1

for i in p[1:]:
  if i <= min(p[:count]):
    result += 1
  
  count += 1

print(result)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

c = 1
for i in range(n):
  if(i != 0 and sum(map(lambda x: p[i] <= x, p[:i])) == i):
    c += 1  
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = list(map(int, input().split()))
count = 0
minn = lis[0]
for i in range(n):
    newlis = lis[0:i+1]
    if  minn >= lis[i]:
        count += 1
        minn = lis[i]
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split(' ')))
res = 0
for i in range(n):
    x = p[:i+1]
    if min(x) >= p[i]:
        res += 1
print(res)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

count = 1; Pj = [P[0]]
for i in range(1, N):
    if min(Pj) > P[i]:
        count += 1
    Pj.append(P[i])

print(count)

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    N = int(input())
    P = list(map(int, input().split()))

    n = 0
    for idx, i in enumerate(P):
        for j in P[:idx]:
            if i > j:
                break
        else:
            n += 1
    print(n)

resolve()

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    p = list(map(int, input().split()))
    lst = []
    for i in range(n):
        flg = True
        for j in range(i):
            if p[i] > p[j]:
                flg = False
        if flg:
            lst.append(i)

    print(len(lst))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    P = list(map(int, args[1].split()))

    count = 0
    for i in range(n):
        b = True
        for j in range(i+1):
            b &= P[i] <= P[j]
        if b:
            count += 1

    return str(count)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
P = [int(i) for i in input().split()]
r = 1
for i in range(1, n):
    if P[i] < min(P[:i]):
        r += 1
print(r)

Submission status: Time Limit Exceeded

Solution code:
import bisect
n = int(input())
p = list(map(int,input().split()))
l = []
c = 0
for i in range(n):
  ind = bisect.bisect_left(l,p[i])
  l.insert(ind, p[i])
  if ind == 0:
    c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(x) for x in input().split()]
count = 0
check = 0
for i in range(N):
    check = 0
    for j in range(i):
        if P[i] <= P[j]:
            check += 1
    if check == i:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(n):
    is_valid = True
    for j in range(i+1):
        if p[i] > p[j]:
            is_valid = False
            break
    if is_valid:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

value = 1

ac = [P[i] for i in range(1, N) if P[i] <= min(P[:i])]

value += len(ac)

print(value)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0

for i in range(n):
    if a[i]==min(a[0:i+1]) :
        
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
    l = p[:i+1]
    if min(l) == p[i]:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0
for i in range(1,len(l)+1):
#     print(l[:i])
#     print(l[i-1])
    if min(l[:i])==l[i-1]:
        count+=1
    
    
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))


def _condition(i, p):
    for j in range(i):
        if p[i] <= p[j]:
            pass
        else:
            return False
    return True


def _result(p):
    sum = 0
    for i in range(len(p)):
        sum += _condition(i, p)
    return sum


print(_result(p))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int, input().split()))
count=1
for i in range(1,N):
  if min(P[:i+1])==P[i]:
    count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n = INT()
    p = LIST()
    ans = 0

    for i in range(n):
        #print(p[:i+1])
        if p[i] <= min(p[:i+1]):
            ans += 1
    print(ans)

if __name__=='__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(i) for i in input().split()]
res = 0

for i in range(0,n):
    flag = True
    for j in range(0,i):
        if p[i] > p[j]:
            flag = False
    if flag:
        res += 1
print(res)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))

# for i in range(1,N):
#     # print(P[i],P[i+1])
#     if P[i-1] <= P[i]:
#         print(i+1)
#         exit()

# print(N)

ans = 0

# 各部分列の最小値
minval = max(P)
for i in range(N):
    # arr = P[0],...,P[i]の最小値
    minval = min(minval,P[i])
    arr = P[0:i+1]

    # P[i]が最小値以下なら
    if P[i] <= minval:
        ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# ABC152c


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    n = int(input())
    p = list(map(int, input().split()))

    cou = 0
    for i in range(n):
        for j in range(i):
            if p[j] < p[i]:
                cou += 1
                break
    print(n-cou)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
nos = list(map(int, input().split()))
count = 0
for j in range(N):
  judge = True
  for k in range(j):
    if nos[k] < nos[j]:
      judge = False
  if judge:
    count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(n):
    tp = p[0:i+1]
    if (min(tp) >= p[i]):
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

A = 0

for i in range(N):
  B = 0
  for j in range(i+1):
    if P[i] <= P[j]:
      B += 1
  if B == i + 1:
    A += 1
print(A)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split( )))
c = 1
for i in range(1,N):
    v = min(set(P[:i]))
    if v >= P[i]:
        c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list1=list(map(int,input().split()))
ln=[list1[0]]
c=0
for i in list1:
    if min(ln)>=i:
        c+=1
    ln.append(i)
print(c)

Submission status: Time Limit Exceeded

Solution code:
# 任意のj <= iに対して P[i] <= P[j]

N = int(input())
P = [int(e) for e in input().split()]
i_count = 0

for i in range(N):
  if P[i] == min(P[:i+1]):
    i_count += 1

print(i_count)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(n):
    if p[i] <= min(p[:i+1]):
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
count = 0
for i in range(N):
    flag = True
    for j in range(i):
        if not P[i] <= P[j]:
            flag = False
            break
    if flag == True:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(n):
    if p[i] <= min(p[:i+1]):
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

cnt = 1
min = N

for i in range(1, N):
  if P[i] > min:
    continue
  for j in range(i-1, -1, -1):
    if P[i] > P[j]:
      break
  else:
    if min >P[i]:
      min = P[i]
    cnt += 1
    if min == 1:
      break


print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))
ans=0
for i in range(N):
    C=True
    for j in range(i):
        if P[j]<P[i]:
            C=False
    if C:
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lstP = list(map(int, input().split()))

count = 0

for i in range(0, len(lstP)):
    lstT = lstP[0:i+1]
    if min(lstT) == lstP[i]:
        count = count + 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt
from fractions import gcd
from itertools import permutations

def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas



N = intinput()
# S = input()
# A, B, C, D, E, F = mulinputs()
datas = list(mulinputs())
# datas = lineinputs(input)

cnt = 0
for i in range(0,N):
    is_clear = True
    for j in range(0,i):
        if datas[j] < datas[i]:
            is_clear = False
            break
    if is_clear:
        cnt += 1

# 出力
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

cnt = 0
flag = True

for i in range(N):
  flag = True
  P_i = P[i]
  for j in range(i + 1):
    if P_i > P[j]:
      flag = False
  if flag:
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = input().split()
p = [int(_) for _ in p]

count = 0
for i in range(n):
  a = p[i]
  alist = p[:i+1]
  alist.sort()
  if alist[0] == a:
    count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(s) for s in input().split()]
count = 0
for a in range(n):
     i = p[a]
     num = -1
     C = 0
     while num != a:
         num+=1
         if p[num]<i:
             C+=1
     if C == 0:
         count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(x) for x in input().split()]

ans = 1
for i in range(1, N):
    tmp = 1
    j = 0
    while j < i:
        if P[i] > P[j]:
            tmp = 0
            break
        j += 1
    ans += tmp
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P_i = list(map(int, input().split()))

total = 0


for i in range(N):
    count = 0
    for j in range(i):
        if P_i[i] <= P_i[j]:
            count += 1

    if count == i:
        total += 1

print(total)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
cnt = 0
for i in range(n):
    judge = 0
    for j in range(i):
        if p[i] > p[j]:
            judge=1
            break
        else:
            pass
    if judge == 0:    
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(n):
    if p[i]<=min(p[:i+1]):
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))
count=1
for i in range(1,N):
    if(P[i]<min(P[0:i])):
        count+=1
    else:
        pass
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
p = list(map(int,input().split()))
cnt=0
for i in range(N):
    a=0
    for j in range(0, i):
       if p[i] <= p[j]:
           continue
       else:
           a+=1
    if a>0:
        continue
    else:
        cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(x) for x in input().split()]

ans = 0
for i in range(n):
   q = p[:i+1]
   if (q[i] == min(q)):
      ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))
ans=0
for i in range(N):
    if min(P[:i+1])==P[i]:
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split(' ')))
count = 0
for i, value in enumerate(P):
    if min(P[:i+1]) == value:
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
#C
N = int(input())
P = list(map(int, input().split()))
ans = 0

for i in range(N):
    frag = True
    for j in range(i):
        if P[i] > P[j]:
            frag = False
            break
    if frag == True:
        ans += 1
        
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

counter = 0

for i in range(n):
  if i == 0:
    counter += 1
  else:
    Min = min(p[:i+1])
  
    if Min == p[i]:
      counter += 1
    else:
      pass
  
print(counter)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

N = int(input())

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

cnt = 0
for i in range(N):
  if min(a_list[:i+1]) >= a_list[i]:
    cnt += 1
    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    N = int(input())
    P = list(map(int, input().split()))

    n = 0
    for i in range(N):
        for j in range(i):
            if P[i] > P[j]:
                break
        else:
            n += 1
    print(n)
    
resolve()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
P = [int(el) for el in input().split(" ")]

ans = 0
for i in range(n):
	for j in range(i):
		if P[i] <= P[j]:
			pass
		else:
			break
	else:
		ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys

N = int(input())
P = [int(v) for v in input().split()]
cnt = 0
for i in range(N):
    flg = True
    for j in range(i):
        if P[i] > P[j]:
            flg = False
            break
    if flg:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(N):
    P_j = P[:i]
    if P_j == []:
        ans += 1
    elif min(P_j) > P[i]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n):
    l = p[:i + 1]
    if min(l) >= p[i]:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
def pin(type=int):
    return map(type,input().split())

N, = pin()
P =list(pin())
#print(N,P)
ans=0
for i in range(len(P)):
    check = 0
    #iより小さいjについて常にP[j]>=P[i]にでかい 
    #P[i]>P[j]はないものをカウント
    for j in range(i):
        if (P[i]>P[j]):
            check = 1
    if (check==0):
        ans += 1
        
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

count = 1
for i in range(1, N):
    for j in range(i):
        if P[j] < P[i]:
            break
    else:
        count = count + 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
pl=list(map(int, input().split()))

cnt = 1
for i in range(1,len(pl)):
    if pl[i] <= min(pl[:i]):
        cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

ans = 0
for i in range(N):
  if P[i] == min(P[:i+1]):
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-


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

count = 0
for i in range(n):
    if i == 0:
        count += 1
    else:
        if min(p[:i]) >= p[i]:
            count += 1
        else:
            pass

print(count)

Submission status: Time Limit Exceeded

Solution code:
import heapq
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    ls = [0 for _ in range(N)]
    ans = 0
    for i in range(N):
        ls[P[i]-1] = 1
        if sum(ls[0:P[i]])==1:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()