115802024-10-27 13:37:36balintCsúcsokpython3Wrong answer 0/100101ms18208 KiB
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    A = [-1] + A + [-1]
    B = [-1] + B + [-1]
    
    A_peaks = 0
    for i in range(N):
        if A[i-1] < A[i] > A[i+1]:
            A_peaks+=1

    B_peaks= 0
    for i in range(M):
        if B[i-1] < B[i] > B[i+1]:
            B_peaks+=1

    print(A_peaks * B_peaks)
main()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer16ms3132 KiB
2Wrong answer16ms3128 KiB
subtask20/16
3Wrong answer57ms14596 KiB
4Wrong answer59ms13056 KiB
5Wrong answer46ms5892 KiB
6Wrong answer61ms14508 KiB
7Accepted52ms15184 KiB
8Wrong answer57ms14156 KiB
subtask30/33
9Wrong answer17ms3252 KiB
10Accepted17ms3144 KiB
11Wrong answer17ms3064 KiB
12Wrong answer16ms3356 KiB
13Wrong answer16ms3128 KiB
14Wrong answer16ms3224 KiB
15Wrong answer17ms3336 KiB
subtask40/51
16Wrong answer94ms18128 KiB
17Wrong answer67ms15156 KiB
18Accepted97ms17804 KiB
19Wrong answer57ms14612 KiB
20Wrong answer61ms14564 KiB
21Accepted94ms18208 KiB
22Wrong answer101ms17864 KiB
23Accepted79ms16724 KiB
24Wrong answer101ms17804 KiB