TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m = map(lambda x: int(x),input().split())

if n == m :
    print('AC')
else :
    print('WA')


a,b = map(lambda x: int(x),input().split())

if n == m :
    print('Yes')
else :
    print('No')


n,m = map(lambda x: int(x),input().split())

if n == m :
    print('Yes')
else :
    print('No')


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=int(input())
if N==M:
  ans="Yes"
else:
  ans="No"
print("ans")

N,M=map(int,input().split())
if N==M:
  ans="Yes"
else:
  ans="No"
print("ans")

N,M=map(int,input().split())
if N==M:
  ans="Yes"
else:
  ans="No"
print(ans)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=list(map(int,input().split()))

if N==M:
    print(YES)
else:
    print(NO)
return

#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int):
    if N==M:
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    solve(N, M)

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=[int(s) for s in input().split()]
if N==M:
  print(Yes)
else:
  print(No)

N,M=[int(s) for s in input().split()]
if N==M:
  print('Yes')
else:
  print('No')


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a, b = map(input().split())
if a == b:
  print("Yes")
else:
  print("No")

a, b = map(int,input().split())
if a == b:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=(int(x) for x in input().split())

if N===M:
    print('Yes')
else:
    print('No')

N,M=(int(x) for x in input().split())

if N==M:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M = map(int,inport().split())
if N == M:
  print("Yes")
else:
  print("No")


N,M = map(str,inport().split())
if N == M:
  print("Yes")
else:
  print("No")

N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n, m = map(int, input())
ans = ""
if n == m:
  ans = "Yes"
else:
  ans = "No"
print(ans)

n, m = map(int, input())
if n == m:
  print("Yes")
else:
  print("No")

n, m = map(int, input().split())
if n == m:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N = list(map(int,input().split()))
if N[0] == N[1]:
  print('YES')
else:
  print('NO')

N, M = map(int, input().split())
if N == M:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
import  numpy as np
import math

if __name__ == "__main__":
  _n, _m = map(int, input().split())
  if _n == _m:
    print('yes')
  else:
    print("no")
  


import  numpy as np
import math

if __name__ == "__main__":
  _n, _m = map(int, input().split())
  if _n == _m:
    print('Yes')
  else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
#100
N, M = map(int,input().split())
if N == M:
    print("AC")
else:
    print("WA")

#100
N, M = map(int,input().split())
if N == M:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M = map(int,input())
if N == M:
  print("Yes")
else:
  print("No")

N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n , m = input().split()
if n == m:
    print("AC")
else :
    print("WA")



n , m = input().split()
if n == m:
    print("Yes")
else :
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N = int(input())
sta = list(map(int, input().split()))
sta2 = []

count_i = 0
for i in sta:
    sta2.append(i)
    if i <= min(sta2):
        count_i += 1

print(count_i)

import sys
import os

#fname = "..\problems\problem1.txt"
#f = open(fname, 'r')


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

if N == M:
    print('Yes')
else:
    print('No')


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a,b = map(int,input().split())

if a = b:
    print("Yes")
else:
    print("No")

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

if a == b:
    print("YES")
else:
    print("NO")

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

if a = b:
    print("YES")
else:
    print("NO")

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

if a == b:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N ,M= map(int,input())
#S = int(input())
if N== M:
    print("Yes")
else:
    print("No")

N ,M= map(int,input().split())
#S = int(input())
if N== M:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a,b=map(int,input().split())
if a>=b:
    print(str(b)*a)
else:
    print(str(a)*b)

n,m=map(int,input().split())
if n==m:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=map(int, input().split())

if X==M:
	print('Yes')
else:
	print('No')

N,M=map(int, input().split())
 
if N==M:
	print('Yes')
else:
	print('No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N = input()
M = input()
N = int(N)
M = int(M)

if N == M:
  print('Yes')
else:
  print('No')

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

if N == M:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m = int(input().split())

if m == n:
  print('Yes')
else:
  print('No')

n = input()
m = input()
if m == n:
  print('Yes')
else:
  print('No')

n,m = input()

if m == n:
  print('Yes')
else:
  print('No')

n = int(input())
m = int(input())

if m == n:
  print('Yes')
else:
  print('No')

N = int(input())
M = int(input())

if M == N:
  print('Yes')
else:
  print('No')

n,m = map(int, input().split())

if m == n:
  print('Yes')
else:
  print('No')


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M = [int(i) for i in input().split()]
if N==M:
  print("YES")
else:
  print("NO")

N,M = [int(i) for i in input().split()]
if N==M:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n, m = list(map(int, input().split()))
if n==m:
    print("yes")
else:
    print("no")

    n, m = list(map(int, input().split()))
    if n==m:
        print("Yes")
    else:
        print("No")

n, m = list(map(int, input().split()))
if n==m:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n, m = int(input())
if n == m:
  print("Yes")
else("No")

n,m = map(int, input().split())
print("Yes") if n == m else print("No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
nm = input().split(' ')

n = int(nm[0])
m = int(nm[1])
print(n)
print(m)

if n > m :
	print('No')
else:
	print('Yes')



nm = input().split()

n = nm[0]
m = nm[1]

if n < m :
	print(No)
else:
	print(Yes)



nm = input().split(' ')

n = int(nm[0])
m = int(nm[1])

if n > m :
	print('No')
else:
	print('Yes')



Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
if N == M:
  print('Yes')
else:
  print('No')

N = input()
M = input()

if N == M:
  print('Yes')
else:
  print('No')

N = int(input())
M = int(input())

if N == M:
  print('Yes')
else:
  print('No')


If N ==M:
  print('Yes')
else print('No')

N, M = input().split()
if N == M:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n, m = map(int, input().split())
if n == m:
  print('yes')
else:
  print('no')


n, m = map(int, input().split())
if n == m:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import fractions
import numpy as np
 
mod = 10**9+7
 
n = int(input())
a = list(map(int, input().split()))
 
div = a[0]
for i in a:
    div = div*i//fractions.gcd(div, i)

ans = 0
for i in a:
    ans += div//i

print(ans%mod)


# -*- coding: utf-8 -*-

n,m = map(int, input().split())

if m == n:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
import sys
from fractions import gcd
input = sys.stdin.readline

n = input()
arr = list(map(int, input().split()))
tmp = arr[0]
for i in arr:
    tmp = tmp*i//gcd(tmp,i)
ans = sum(tmp//a for a in arr)
ans = ans % (10**9+7)
print(ans)

txt = input().split(' ')
if txt[0] == txt[1]:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
m,n = input().split(" ")
if m == n:
    print("YES")
else:
    print("NO")    

m,n = input().split(" ")
if m == n:
    print("Yes")
else:
    print("No")    

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M = input().split(" ")
if N > M:
  str = M
  print(str*int(N))
else:
  str = N
  print(str*int(M))

N,M = input().split(" ")
if N == M:
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a=input()
b=input()
a==b?print('Yes'):print('No')

a=input()
b=input()
if int(a)==int(b):
  print('Yes')
  else:
    print('No')

a=input().split()
if int(a[0]) == int(a[1]):
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a,b=map(int,input().split())
print('YES' if a==b else'No')

a,b=map(int,input().split())
print('Yes' if a==b else'No')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N = int(input())
P = []
counter = 0
input_string = input()
P = input_string.split()

for i in range(N):
    for j in range(N):
        if N == int(P[i]):
            counter = counter + 1
            if N != 1:
                N = N - 1
                break
            else: 
                break
        elif N < int(P[i]):
            break
        else:
            if N != 1:
                N = N - 1   

print(counter)


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

if N == M:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
i = list(map(int, input().split()))

min = i[0]
count = 1

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

print(count)


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

min = i[0]
count = 1

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

print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
from numba import double
from numba.decorators import jit

N = int(input())
Ps = list(map(int, input().split()))
Ps = np.array(Ps)
count = 0

@jit
for i in range(N):
    low = Ps[i]
    if ( np.sum(Ps[:i] < low) == 0):
        count += 1

print(count)

N = int(input())
Ps = list(map(int, input().split()))
count = 0
min = Ps[0]+1

for i in range(N):
    if (Ps[i] < min):
        min = Ps[i]
        count += 1

print(count)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
p=list(map(int,input().split()))
m=10**6
ans=1
for i in p:
  if m>i:
    m=i
    ans+=1
  
print(ans)

n=int(input())
p=list(map(int,input().split()))
m=10**6
ans=0
for i in p:
  if m>i:
    m=i
    ans+=1
  
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a= int(input())
b= input().split()
compare=b[0]
c=0

for i in range(a):
    if (compare>=int(b[i])):
        compare=int(b[i])
        c=c+1
        
print(c)



_ = int(input())
numbers = list(map(int, input().split()))

curr_min = numbers[0]
count = 0
for num in numbers:
    if num <= curr_min:
        count += 1
        curr_min = num

print(count)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
P_lis = list(map(int,input().split()))
count = 0
min_P = P_lis[0]
for p in P_list:
  if p <= min_P:
    min_P = p
    count += 1

print(count)

import numpy as np
N = int(input())
P_lis = list(map(int,input().split()))
 
count = 0
for i in range(N):
  lis = P_lis[0:i+1]
  lis = lis - lis[i]
  if -1 in np.sign(lis):
    count += 1
print(count)

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

count = 0
for i in range(N):
    lis = P_lis[0:i+1]
    if lis[i] == min(lis):
        count += 1
print(N-count)

N = int(input())
P_lis = list(map(int, input().split()))
 
max_N = 2*10**5
count = 0 
for p in P_lis:
  if p <= max_N:
    count += 1
    dummy = p
print(count)

import numpy as np
N = int(input())
P_lis = np.array(list(map(int,input().split())))
 
count = 0
for i in range(N):
  lis = P_lis[0:i+1]
  lis = lis - lis[i]
  if -1 in np.sign(lis):
    count += 1
print(count)

N = int(input())
P_lis = list(map(int, input().split()))
 
dummy = 2*10**5
answer = 0
 
for p in P_lis:
  if p <= dummy:
    answer += 1
    dummy = p
print(answer)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
A=list(map(int,input().split()))
qq=A[0]
ans=1
for i in range(n-1):
  if qq<A[i+1]:
    qq=A[i+1]
    continue
  else:
    ans+=1
print(ans)
    

n=int(input())
A=list(map(int,input().split()))
ans=1
qq=A[0]
for i in range(n-1):
  if qq<A[i+1]:
    qq=A[i+1]
    continue
  else:
    ans+=1
print(ans)


n=int(input())
A=list(map(int,input().split()))
ans=1
qq=A[0]
for i in range(n):
  if qq<A[i+1]:
    qq=A[i+1]
    continue
  else:
    ans+=1
print(ans)

n=int(input())
A=list(map(int,input().split()))
ans=1
qq=A[0]
for i in range(n-1):
  if qq<A[i+1]:
    continue
  if qq>=A[i+1]:
    qq=A[i+1]
    ans+=1
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-

N = input("")
L = input("").split(" ")
suc = N

for i in range(int(N)):
    for j in range(i):
        if (L[j] < L[i]):
            suc -= 1
            break
    
print(suc)

N = input("")
L = input("").split(" ")
suc = int(N)
min_ = 200001

for i in range(int(N)):
    if (L[i] == 1):
        continue
    if (min_ < L[i]):
        suc -= 1
        continue
    for j in range(i):
        if (L[j] < L[i]):
            suc -= 1
            break
    
print(suc)

N = input("")
L = input("").split(" ")
suc = int(N)
min_ = 200001

for i in range(int(N)):
    if (L[i] == 1):
        min_= 1
        continue
    if (int(min_) < int(L[i])):
        suc -= 1
        continue
    if (int(min_) >= int(L[i])):
        min_ = L[i]
print(suc)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
p=list(map(int,input().split()))
ans=p[0]
cnt=1
for i in range(1,n):
	if p[i]<a:
		cnt+=1
		a=p[i]
print(cnt)


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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


def checkAllLess(tgt):
    for id in range(tgt):
        # print("id=" + str(id) + ", pn[]=" + str(pn[id]) + ", tgt=" + str(tgt))
        if(pn[id] < pn[tgt]):
            # print('False')
            return False
    # print('True')
    return True


cnt = 1
min = pn[0]
for i in range(n):
    if (min > i & & checkAllLess(i)):
        cnt += 1
    if (min > pn[i]):
        min = pn[i]
    # print(str(i) + ":" + str(cnt))

print(cnt)


#!/usr/bin/env python
# -*- coding: utf-8 -*-

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


def checkAllLess(tgt):
    for id in range(tgt):
        # print("id=" + str(id) + ", pn[]=" + str(pn[id]) + ", tgt=" + str(tgt))
        if(pn[id] < pn[tgt]):
            # print('False')
            return False
    # print('True')
    return True


cnt = 1
min = pn[0]
for i in range(n):
    if (min > i & & checkAllLess(i)):
        cnt += 1
    if (min > pn[i]):
        min = pn[i]
    # print(str(i) + ":" + str(cnt))

print(cnt)


#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

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

print(cnt)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p < min_p:
    min_p = p
    cnt += 1
print(cnt)


N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
P = list(map(int, input().split( )))
mas = P[0]
ans = 1
for i in range(n-1):
  if mas >= P[i+1]:
    ans += 1
  mas = max(mas,P[i+1])

print(ans)

n = int(input())
P = list(map(int, input().split( )))
mas = P[0]
ans = 1
for i in range(n-1):
  if mas >= P[i+1]:
    ans += 1
  mas = min(mas,P[i+1])

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
da = list(map(int,input().split()))
ans = 0
now_max = 0
for i in range(n):
  if now_max < da[i]:
    ans += 1
    now_max = da[i]
print(ans)

n = int(input())
da = list(map(int,input().split()))
ans = 0
now_min = n+1
for i in range(n):
  if now_min > da[i]:
    ans += 1
    now_min = da[i]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from sys import stdin

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

a=p[0]
cnt=0

for i in range(1,n):
    if p[i]<=a
    cnt+=1
    a = p[1]

print(cnt)
      

from sys import stdin

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

a=p[0]
cnt=1

for i in range(1,n):
    if p[i]<=a
    cnt+=1
    a = p[i]

print(cnt)
      

from sys import stdin

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

a=p[0]
cnt=1

for i in range(1,n):
    if p[i]<=a:
    cnt+=1
    a = p[i]

print(cnt)
      

from sys import stdin

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

a=p[0]
cnt=0

for i in range(1,n):
    if p[i]<=a
    cnt+=1
    a = p[i]

print(cnt)
      

from sys import stdin

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

a=p[0]
cnt=1

for i in range(1,n):
    if p[i]<a:
        cnt+=1
        a = p[i]

print(cnt)
      

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as num
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(1):
        l=np.amin(np.array(P[:i+1]))
        if P[i]>l:
            flag=False
            break
    if flag:
        count+=1
    else:
        flag=True
print(count)

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
total = input()
L = list(map(int, input().split()))
sum=0
Q=0
for i in range(int(total)):
  if i == 0:
    Q=L[i]
    sum = sum  + 1
  else:
    if Q>=L[i]:
      sum = sum  + 1
    else:
      Q=L[i]
print(sum)


total = input()
L = list(map(int, input().split()))
sum=0
Q=0
for i in range(int(total)):
  if i == 0:
    Q=L[i]
    sum = sum  + 1
  else:
    if Q>=L[i]:
      sum = sum  + 1
      Q=L[i]
print(sum)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
L=map(int,input().split())
ans=1
M=L[0]
for i in range(1,N):
  if M>=L[1]:
    M=L[1]
    ans+=1
  else:
    continue
print(ans)

N=int(input())
L=list(map(int,input().split()))
ans=1
M=L[0]
for i in range(1,N):
  if M>=L[1]:
    M=L[1]
    ans+=1
  else:
    continue
print(ans)

N=int(input())
L=list(map(int,input().split()))
ans=1
M=L[0]
for i in range(1,N):
  if M>=L[i]:
    M=L[i]
    ans+=1
  else:
    continue
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
from collections import Counter


def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

n = int(input())
p_list = list(map(int, input().split()))
ans = 1
min = p_list[0]
for i in range(n - 1):
  if min >= p_list[i + 1]:
    ans += 1
    min =p_list[i]
print(ans)

import numpy as np
from collections import Counter


def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

n = int(input())
p_list = list(map(int, input().split()))
ans = 1
for i in range(n - 1):
  print(p_list[i], p_list[i + 1])
  if p_list[i] >= p_list[i + 1]:
    ans += 1
print(ans)

import numpy as np
from collections import Counter


def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())
array = list(map(int, input().strip().split()))
out = 0
for i in range(a):
    out = out + 1 if array[i] == min(array[0:i+1])
print(out)

a = int(input())
array = list(map(int, input().strip().split()))
out = 0
min_num = array[0]
for i in array:
    min_num = min(min_num, i)
    out = out + 1 if i == min_num else out
print(out)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())
b = list(map(int,input().split()))
b[0:0]=[0]
c = 0
for i in range(1,a+1):
  switch = 0
  for j in range(0,i):
    if b[i] > b[j]:
      switch = 1
    if switch != 1:
      c += 1
print(c)
      
      
  


a = int(input())
b = list(map(int,input().split()))
b[0:0]=0
c = 0
for i in range(1,a+1):
  switch = 0
  for j in range(0,i):
    if b[i] < b[j]:
      switch = 1
    if switch == 1:
      c += 1
print(c)
      
      
  

a = int(input())
b = list(map(int,input().split()))
b[0:0]=[0]
c = 0
for i in range(1,a+1):
  switch = 0
  for j in range(0,i):
    if b[i] > b[j]:
      switch = 1
  if switch != 1:
    c += 1
print(c)
      
      
  


a = int(input())
b = list(map(int,input().split()))
c = 1
k = b[0]
for i in range(1,a):
  if k>b[i]:
  	
  	k = b[i]
  	c+=1
print(c)
      

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
lis = list(map(int, input().split()))
haha = [min(lis[:i+1]) for i in range(N)]
sum(list(map(lambda x: x <= 0, [lis[i] - haha[i] for i in range(N)])))

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

sum(list(map(lambda x: x <= 0, [lis[i] - min(lis[:i+1]) for i in range(N)])))

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

counter=0
minimum = 10000000
for i in range(N):
    minimum = min([minimum,lis[i]])
    counter += int(lis[i] <= minimum)
print(counter)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
p = [int(x) for x in input().split()]

min_p = 1000000000000

count = 0
 
for i in p:
    
    print(i)
    if (min_p >= i):
        min_p = i
    if (min_p >= i):
        count += 1

print(count)


def calc(n, p):
    min_p = 200000

    count = 0
    
    for i in p:
        
        if (min_p >= i):
            min_p = i
        if (min_p >= i):
            count += 1

    print(count)


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

calc(n, p)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
a = 0
if A[0] == 1:
    print(1)
else:
    for i in range(N-1):
        if A[0] 

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
min=2*(10**5)
cnt=0

for i in map(int,input().split())
    if min>=i:min=i
    cnt+=1

print(cnt)

n=int(input())
min=2*(10**5)
cnt=0

for i in map(int,input().split()):
    if min>=i:
         min=i
         cnt+=1

print(cnt)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
P=list(map(int,input().split()))

P.reverse()
ans=0
MAX=P[0]
for i in range(N):
    if P[i]>=MAX:
        ans=ans+1
        MAX=P[i]
print(ans)

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

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


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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np

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

print(p)
cnt = 0
for i in range(n):
    if all(map(lambda pj: p[i] <= pj, p[:i + 1])):
        cnt += 1
        if p[i] == 1:
            break


print(cnt)

import numpy as np

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

cnt = 0
for i in range(n):
    if p[i] <= np.max(p[:i+1]):
    
        cnt += 1
        if p[i] == 1:
            break


print(cnt)

import numpy as np

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

print(p)
cnt = 0
for i in range(n):
    if p[i] <= np.max(p[:i+1]):
    
        cnt += 1
        if p[i] == 1:
            break


print(cnt)

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

cnt = 0
pjmin = P[0]
for pi in P:
    if pi <= pjmin:
        cnt +=1
        pjmin = pi
        if pi ==1:
            break
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
x = list(map(int, input().split()))
curr = 10 ** 9
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)

n = int(input())
x = list(map(int, input().split()))
curr = 10 ** 9
ans = 0
for p in x:
    if p < curr:
        ans += 1
        curr = p
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
Pn = list(map(int, input().split()))

p_min = Pn[0]
cnt = 0
for i in Pn:
    if i <=p_min:
        cnt += 1
    p_min = min(p_min, i)


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

p_min = Pn[0]
count = 0
for i in Pn:
    if i <=p_min:
        count += 1
    p_min = min(p_min, i)
print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=input(int)
s=list(map(int,input().split()))
count=0
min=s[0]
for i in range(0,a):
    if min>=s[i]:
        count+=1
        min=s[i]
print(count) 

a=input()
s=list(map(int,input().split()))
count=0
counter=0
for i in a:
    counter=0
    for j in range(0,i):
        if s[i]>s[j] and counter==0:
            count+=1
            counter+=1
print(count) 

a=input()
s=list(map(int,input().split()))
count=0
min=s[0]
for i in range(1,a):
    if min>s[i] :
        count+=1
        min=s[j]
print(count) 

a=input()
s=list(map(int,input().split()))
count=0
min=s[0]
for i in range(1,a):
    if min>s[i] :
        count+=1
        min=s[j]
print(count) 

a=input()
s=list(map(int,input().split()))
count=0
counter=0
for i in a:
    counter=0
    for j in range(0,i):
      if counrer==1:
        break
        if s[i]>s[j] :
            count+=1
            counter+=1
print(count) 

a=int(input())
s=list(map(int,input().split()))
count=0
min=s[0]
for i in range(0,a):
    if min>=s[i]:
        count+=1
        min=s[i]
print(count) 

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())

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

l = []

for i in range(n):
    l.append([n+1, p[i]])

l.sort(key = lambda x : x[1])

ans = 0

for i in l:
    if i[0] >= i[1]:
        ans += 1

print(ans)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())

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

m = p[0]
ans = 0

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


print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def main():
    N = int(input())
    P = list(map(int,input().split()))

    count = 0
    flag = True

    for i in range(N):
        for j in range(i):
            if(i == j):
                continue
            if(P[i] == max(P)):
                flag = False
                break
            if(P[i] <= i):
                flag = False
                break
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)

if __name__ == "__main__":
    main()

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

    count = 0

    for i in range(N):
        Pj = P[0:i+1]
        min_P = min(Pj)
        if(P[i] <= min_P):
            count += 1
        else:
            break

    print(count)


if __name__ == "__main__":
    main()

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

    count = 0
    flag = True

    for i in range(N):
        for j in range(i):
            if(i == j):
                continue
            if(P[i] == max(P)):
                flag = False
                break
            if(P[i] < i):
                flag = False
                break
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)

if __name__ == "__main__":
    main()


import sys

def main():
    input = sys.stdin.readline

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

    #result = list()

    minimum = P[0]
    count = 1
    for i in range(N):
        if(minimum > P[i]):
            minimum = P[i]
            count += 1
    print(count)
#        Pj = list(P[j] for j in range(i+1))
        #print(Pj)
        #Pj = P[0:i+1]
#        min_P = min(Pj)
#        result.append(min_P)
#        print(min_P)
#        if(P[i] == min_P):
#            count += 1

    

if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=input()
p=list(map(int,input().split()))
ans,m=0,p[0]
for i in range(n):
    m=min(m,p[i])
    if m==p[i]: ans+=1
print(ans)

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

Verdicts: Runtime Error

Accepted