結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 22:58:34
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 606 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 282,736 KB
最終ジャッジ日時 2024-04-19 21:19:12
合計ジャッジ時間 12,356 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
57,728 KB
testcase_01 AC 42 ms
51,968 KB
testcase_02 AC 43 ms
51,968 KB
testcase_03 AC 43 ms
57,856 KB
testcase_04 AC 39 ms
52,352 KB
testcase_05 AC 42 ms
57,656 KB
testcase_06 AC 51 ms
63,488 KB
testcase_07 AC 56 ms
65,788 KB
testcase_08 AC 46 ms
59,648 KB
testcase_09 AC 57 ms
66,688 KB
testcase_10 AC 43 ms
58,240 KB
testcase_11 AC 44 ms
58,240 KB
testcase_12 AC 100 ms
77,304 KB
testcase_13 AC 43 ms
57,728 KB
testcase_14 AC 133 ms
79,980 KB
testcase_15 AC 43 ms
57,856 KB
testcase_16 AC 60 ms
67,456 KB
testcase_17 AC 43 ms
57,728 KB
testcase_18 AC 42 ms
57,600 KB
testcase_19 AC 42 ms
57,728 KB
testcase_20 AC 44 ms
57,728 KB
testcase_21 AC 43 ms
57,728 KB
testcase_22 AC 44 ms
58,060 KB
testcase_23 AC 43 ms
58,752 KB
testcase_24 AC 45 ms
60,288 KB
testcase_25 AC 105 ms
79,288 KB
testcase_26 AC 187 ms
81,792 KB
testcase_27 AC 43 ms
58,240 KB
testcase_28 AC 40 ms
57,856 KB
testcase_29 AC 68 ms
72,320 KB
testcase_30 AC 1,079 ms
197,108 KB
testcase_31 AC 128 ms
79,544 KB
testcase_32 AC 1,487 ms
192,456 KB
testcase_33 AC 1,887 ms
183,452 KB
testcase_34 AC 49 ms
63,104 KB
testcase_35 AC 43 ms
57,472 KB
testcase_36 AC 77 ms
76,800 KB
testcase_37 AC 82 ms
77,256 KB
testcase_38 AC 1,475 ms
273,284 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())

G=[]
S=0
for i in range(M):
    p,q,c=map(int,input().split())
    S=max(S,p,q)
    G.append((p,q,c))

E=[[] for _ in range(S+1)]
for (p,q,c) in G:
    E[p].append((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