Submission #12752283


Source Code Expand

Copy
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

""" 道は一本! """

N, M = map(int, readline().split())
H = [0] + list(map(int, readline().split()))
A = [0] * (N + 1)

m = map(int, read().split())
for a, b in zip(m, m):
    for _ in range(2):
        A[a] = max(A[a], H[b])
        a, b = b, a

print(sum(x > y for x, y in zip(H, A)))

Submission Info

Submission Time
Task C - Peaks
User maspy
Language Python (3.8.2)
Score 300
Code Size 427 Byte
Status AC
Exec Time 196 ms
Memory 25728 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 19
Set Name Test Cases
Sample Sample_01.txt, Sample_02.txt
All Sample_01.txt, Sample_02.txt, maxrand_01.txt, maxrand_02.txt, maxrand_03.txt, ni_01.txt, ni_02.txt, rand_01.txt, rand_02.txt, rand_03.txt, same_01.txt, same_02.txt, same_03.txt, small_01.txt, small_02.txt, small_03.txt, uni_01.txt, uni_02.txt, uni_03.txt
Case Name Status Exec Time Memory
Sample_01.txt AC 17 ms 9096 KB
Sample_02.txt AC 18 ms 8880 KB
maxrand_01.txt AC 192 ms 25548 KB
maxrand_02.txt AC 192 ms 25716 KB
maxrand_03.txt AC 193 ms 25544 KB
ni_01.txt AC 17 ms 9096 KB
ni_02.txt AC 20 ms 8876 KB
rand_01.txt AC 196 ms 25616 KB
rand_02.txt AC 193 ms 25604 KB
rand_03.txt AC 195 ms 25664 KB
same_01.txt AC 179 ms 24788 KB
same_02.txt AC 185 ms 24620 KB
same_03.txt AC 185 ms 24832 KB
small_01.txt AC 18 ms 9120 KB
small_02.txt AC 19 ms 9092 KB
small_03.txt AC 22 ms 9024 KB
uni_01.txt AC 182 ms 25728 KB
uni_02.txt AC 181 ms 25548 KB
uni_03.txt AC 189 ms 25480 KB