Submission #65649577


Source Code Expand

#ABC405_20250510_B
N,M=map(int,input().split())
A=list(map(int,input().split()))
L=[0]*(N+1)
for i in range(N):
    L[A[i]]+=1
for i in range(1,M+1):
    if(L[i]==0):
        exit(print(0))
for i in range(N):
    if(L[A[N-i-1]]==1):
        exit(print(i+1))
    else:
        L[A[N-i-1]]-=1

Submission Info

Submission Time
Task B - Not All
User Konini
Language Python (PyPy 3.10-v7.3.12)
Score 200
Code Size 305 Byte
Status AC
Exec Time 57 ms
Memory 76724 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 20
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 56 ms 76176 KiB
00_sample_01.txt AC 55 ms 76676 KiB
00_sample_02.txt AC 55 ms 76308 KiB
01_random_00.txt AC 55 ms 76704 KiB
01_random_01.txt AC 57 ms 76604 KiB
01_random_02.txt AC 57 ms 76316 KiB
01_random_03.txt AC 55 ms 76456 KiB
02_random2_00.txt AC 56 ms 76432 KiB
02_random2_01.txt AC 55 ms 76452 KiB
02_random2_02.txt AC 55 ms 76352 KiB
02_random2_03.txt AC 56 ms 76344 KiB
02_random2_04.txt AC 56 ms 76724 KiB
02_random2_05.txt AC 56 ms 76592 KiB
02_random2_06.txt AC 56 ms 76640 KiB
02_random2_07.txt AC 55 ms 76612 KiB
03_handmade_00.txt AC 55 ms 76592 KiB
03_handmade_01.txt AC 56 ms 76312 KiB
03_handmade_02.txt AC 55 ms 76460 KiB
03_handmade_03.txt AC 55 ms 76452 KiB
03_handmade_04.txt AC 55 ms 76428 KiB