提出 #75084191


ソースコード 拡げる

nums = input().split()
N = int(nums[0])
M = int(nums[1])
current = 1
item = ["1"]
friends = []
for i in range(0, M):
  friends.append(input().split())
for i in range(1, N+1):
  for j in range(0, M):
    if str(i) in item:
      if str(i) == friends[j][0] and friends[j][1] not in item:
        item.append(friends[j][1])
print(len(item))

提出情報

提出日時
問題 C - Straw Millionaire
ユーザ chikaraispower
言語 Python (PyPy 3.11-v7.3.20)
得点 0
コード長 350 Byte
結果 TLE
実行時間 > 2000 ms
メモリ 172512 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 300
結果
AC × 3
AC × 6
TLE × 16
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 45 ms 79508 KiB
00_sample_01.txt AC 44 ms 79900 KiB
00_sample_02.txt AC 43 ms 79900 KiB
01_handmade_00.txt AC 320 ms 170112 KiB
01_handmade_01.txt AC 323 ms 170020 KiB
01_handmade_02.txt AC 334 ms 170256 KiB
01_handmade_03.txt TLE > 2000 ms 172272 KiB
01_handmade_04.txt TLE > 2000 ms 172148 KiB
01_handmade_05.txt TLE > 2000 ms 172512 KiB
01_handmade_06.txt TLE > 2000 ms 172316 KiB
01_handmade_07.txt TLE > 2000 ms 172400 KiB
01_handmade_08.txt TLE > 2000 ms 172496 KiB
01_handmade_09.txt TLE > 2000 ms 137640 KiB
02_random_00.txt TLE > 2000 ms 172256 KiB
02_random_01.txt TLE > 2000 ms 159944 KiB
02_random_02.txt TLE > 2000 ms 143272 KiB
02_random_03.txt TLE > 2000 ms 172320 KiB
02_random_04.txt TLE > 2000 ms 172272 KiB
02_random_05.txt TLE > 2000 ms 168636 KiB
03_killer_00.txt TLE > 2000 ms 172424 KiB
03_killer_01.txt TLE > 2000 ms 172340 KiB
03_killer_02.txt TLE > 2000 ms 172196 KiB