Submission #75069711


Source Code Expand

N, M = map(int, input().split())
route = tuple((set()for _ in range(N)))
for _ in range(M):
    Ai, Bi = map(int, input().split())
    route[Ai-1].add(Bi-1)
having = {0}
got = {0}
while having:
    search = having.pop()
    yet = route[search]-got
    got |= yet
    having |= yet
print(len(got))

Submission Info

Submission Time
Task C - Straw Millionaire
User hydroxed_sil
Language Python (PyPy 3.11-v7.3.20)
Score 300
Code Size 308 Byte
Status AC
Exec Time 787 ms
Memory 233620 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 22
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_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 03_killer_00.txt, 03_killer_01.txt, 03_killer_02.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 55 ms 79748 KiB
00_sample_01.txt AC 55 ms 79776 KiB
00_sample_02.txt AC 54 ms 79788 KiB
01_handmade_00.txt AC 330 ms 108752 KiB
01_handmade_01.txt AC 311 ms 108964 KiB
01_handmade_02.txt AC 325 ms 108864 KiB
01_handmade_03.txt AC 410 ms 138136 KiB
01_handmade_04.txt AC 396 ms 112704 KiB
01_handmade_05.txt AC 787 ms 225028 KiB
01_handmade_06.txt AC 757 ms 225176 KiB
01_handmade_07.txt AC 634 ms 182728 KiB
01_handmade_08.txt AC 661 ms 182908 KiB
01_handmade_09.txt AC 311 ms 171512 KiB
02_random_00.txt AC 597 ms 167520 KiB
02_random_01.txt AC 431 ms 127768 KiB
02_random_02.txt AC 298 ms 119588 KiB
02_random_03.txt AC 500 ms 128600 KiB
02_random_04.txt AC 421 ms 131380 KiB
02_random_05.txt AC 423 ms 127612 KiB
03_killer_00.txt AC 434 ms 232256 KiB
03_killer_01.txt AC 438 ms 233620 KiB
03_killer_02.txt AC 461 ms 206028 KiB