結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 22:55:01
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 545 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 277,564 KB
最終ジャッジ日時 2024-04-19 21:05:23
合計ジャッジ時間 9,478 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
64,912 KB
testcase_01 AC 39 ms
57,476 KB
testcase_02 AC 38 ms
58,344 KB
testcase_03 AC 41 ms
57,616 KB
testcase_04 AC 39 ms
58,876 KB
testcase_05 AC 39 ms
59,152 KB
testcase_06 AC 49 ms
64,600 KB
testcase_07 AC 57 ms
67,780 KB
testcase_08 AC 43 ms
59,724 KB
testcase_09 AC 55 ms
67,032 KB
testcase_10 AC 40 ms
58,640 KB
testcase_11 AC 41 ms
59,032 KB
testcase_12 AC 97 ms
76,772 KB
testcase_13 AC 39 ms
59,148 KB
testcase_14 AC 125 ms
79,596 KB
testcase_15 AC 39 ms
59,308 KB
testcase_16 AC 55 ms
69,320 KB
testcase_17 AC 38 ms
58,204 KB
testcase_18 AC 39 ms
58,140 KB
testcase_19 AC 41 ms
58,424 KB
testcase_20 AC 40 ms
59,336 KB
testcase_21 AC 39 ms
58,148 KB
testcase_22 AC 40 ms
59,244 KB
testcase_23 AC 41 ms
58,804 KB
testcase_24 AC 47 ms
62,464 KB
testcase_25 AC 106 ms
81,020 KB
testcase_26 AC 173 ms
81,200 KB
testcase_27 AC 40 ms
59,144 KB
testcase_28 AC 39 ms
58,420 KB
testcase_29 AC 68 ms
73,632 KB
testcase_30 AC 1,001 ms
196,480 KB
testcase_31 AC 123 ms
79,564 KB
testcase_32 AC 1,400 ms
193,268 KB
testcase_33 AC 1,681 ms
183,444 KB
testcase_34 AC 48 ms
64,456 KB
testcase_35 AC 40 ms
58,648 KB
testcase_36 AC 75 ms
76,832 KB
testcase_37 AC 78 ms
77,000 KB
testcase_38 AC 1,359 ms
277,564 KB
testcase_39 TLE -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

A=10**9+7
N,M,K=map(int,input().split())
S=300

E=[set() for _ in range(S+1)]
for i in range(M):
    p,q,c=map(int,input().split())
    E[p].add((q,c))

H={(F,0,0):1 for F in range(1,S+1)}
def f(F,R,L):
    if R<0:
        return 0
    """
    F:From
    R:残り複雑度
    L:残りコード数
    """
    
    if (F,R,L) in H:
        return H[(F,R,L)]
    
    if L==0:
        return 0

    K=0
    for (q,c) in E[F]:
        K=(K+f(q,R-c,L-1))%A

    H[(F,R,L)]=K
    return K

V=0
for i in range(1,S+1):
    V=(V+f(i,K,N-1))%A
print(V)
0