結果

問題 No.1480 Many Complete Graphs
ユーザー ああいいああいい
提出日時 2021-12-28 22:07:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 670 bytes
コンパイル時間 627 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 38,688 KB
最終ジャッジ日時 2024-04-10 14:27:45
合計ジャッジ時間 12,200 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
16,512 KB
testcase_01 AC 27 ms
10,880 KB
testcase_02 AC 27 ms
11,008 KB
testcase_03 AC 27 ms
11,008 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 AC 28 ms
11,008 KB
testcase_06 AC 28 ms
10,880 KB
testcase_07 AC 28 ms
10,752 KB
testcase_08 AC 28 ms
10,880 KB
testcase_09 AC 50 ms
11,008 KB
testcase_10 AC 61 ms
11,136 KB
testcase_11 AC 40 ms
10,880 KB
testcase_12 AC 46 ms
10,880 KB
testcase_13 AC 91 ms
22,656 KB
testcase_14 AC 73 ms
18,560 KB
testcase_15 AC 1,587 ms
28,288 KB
testcase_16 AC 721 ms
23,168 KB
testcase_17 AC 854 ms
22,272 KB
testcase_18 AC 193 ms
17,920 KB
testcase_19 AC 743 ms
22,016 KB
testcase_20 AC 1,584 ms
24,960 KB
testcase_21 AC 100 ms
22,144 KB
testcase_22 AC 65 ms
16,896 KB
testcase_23 AC 170 ms
33,920 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
evil_aftercontest.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
G = [[] for _ in range(N + 1 + M)]
for i in range(M):
    l = list(map(int,input().split()))
    for k in range(2,len(l)):
        G[l[k]].append(N + i + 1)
        G[N + i + 1].append((l[k],l[1]))

import heapq
q = []
heapq.heapify(q)
heapq.heappush(q,(0,1))
C = 10 ** 16
dist = [C] * (N + 1)
dist[1] = 0
import sys
while len(q):
    d,i = heapq.heappop(q)
    if i == N:
        print(d)
        exit()
    if d > dist[i]:
        continue
    for m in G[i]:
        for s,c in G[m]:
            u = (i + s + 1) // 2 + c + dist[i]
            if u < dist[s]:
                dist[s] = u
                heapq.heappush(q,(u,s))
print(-1)
0