結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 22:45:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 569 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 283,640 KB
最終ジャッジ日時 2024-04-19 21:03:44
合計ジャッジ時間 12,179 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
62,464 KB
testcase_01 AC 35 ms
56,832 KB
testcase_02 AC 38 ms
56,832 KB
testcase_03 AC 37 ms
57,212 KB
testcase_04 AC 37 ms
57,144 KB
testcase_05 AC 37 ms
57,600 KB
testcase_06 AC 45 ms
62,336 KB
testcase_07 AC 47 ms
63,616 KB
testcase_08 AC 40 ms
58,752 KB
testcase_09 AC 56 ms
66,560 KB
testcase_10 AC 39 ms
57,344 KB
testcase_11 AC 39 ms
57,856 KB
testcase_12 AC 81 ms
76,928 KB
testcase_13 AC 39 ms
57,856 KB
testcase_14 AC 114 ms
79,360 KB
testcase_15 AC 41 ms
57,728 KB
testcase_16 AC 54 ms
66,688 KB
testcase_17 AC 39 ms
57,344 KB
testcase_18 AC 38 ms
56,832 KB
testcase_19 AC 38 ms
56,960 KB
testcase_20 AC 38 ms
57,984 KB
testcase_21 AC 39 ms
57,216 KB
testcase_22 AC 37 ms
57,088 KB
testcase_23 AC 37 ms
57,600 KB
testcase_24 AC 41 ms
59,648 KB
testcase_25 AC 90 ms
79,088 KB
testcase_26 AC 163 ms
80,704 KB
testcase_27 AC 41 ms
58,240 KB
testcase_28 AC 39 ms
57,088 KB
testcase_29 AC 50 ms
65,024 KB
testcase_30 AC 1,019 ms
194,624 KB
testcase_31 AC 128 ms
79,420 KB
testcase_32 AC 1,393 ms
191,840 KB
testcase_33 AC 1,746 ms
182,880 KB
testcase_34 AC 43 ms
60,672 KB
testcase_35 AC 39 ms
57,216 KB
testcase_36 AC 81 ms
76,800 KB
testcase_37 AC 84 ms
77,076 KB
testcase_38 AC 1,383 ms
275,216 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=[[] for _ in range(S+1)]
for i in range(M):
    p,q,c=map(int,input().split())
    E[p].append((q,c))
    

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

    K=0
    for (q,c) in E[F]:
        if R>=c:
            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%A)
0