# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1154185 | ainunnajib | Po (COCI21_po) | Pypy 3 | 160 ms | 67304 KiB |
n = int(input())
l = list(map(int, input().split()))
ans = 0
stack = [0]
for x in l:
while stack[-1] >= x:
stack.pop()
if stack[-1] < x:
stack.append(x)
ans += 1
print(ans)
Compilation message (stdout)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |