結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 22:48:41
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 539 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 285,384 KB
最終ジャッジ日時 2023-08-01 22:02:45
合計ジャッジ時間 13,482 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
81,956 KB
testcase_01 AC 75 ms
74,896 KB
testcase_02 AC 74 ms
74,648 KB
testcase_03 AC 72 ms
75,080 KB
testcase_04 AC 73 ms
75,020 KB
testcase_05 AC 73 ms
74,860 KB
testcase_06 AC 83 ms
76,120 KB
testcase_07 AC 84 ms
76,004 KB
testcase_08 AC 78 ms
74,860 KB
testcase_09 AC 86 ms
75,992 KB
testcase_10 AC 76 ms
74,588 KB
testcase_11 AC 76 ms
74,976 KB
testcase_12 AC 115 ms
78,172 KB
testcase_13 AC 74 ms
75,064 KB
testcase_14 AC 147 ms
81,232 KB
testcase_15 AC 74 ms
74,588 KB
testcase_16 AC 86 ms
75,952 KB
testcase_17 AC 72 ms
74,980 KB
testcase_18 AC 72 ms
74,700 KB
testcase_19 AC 72 ms
74,592 KB
testcase_20 AC 74 ms
74,752 KB
testcase_21 AC 74 ms
74,976 KB
testcase_22 AC 73 ms
74,944 KB
testcase_23 AC 74 ms
74,960 KB
testcase_24 AC 79 ms
76,048 KB
testcase_25 AC 129 ms
82,076 KB
testcase_26 AC 215 ms
82,856 KB
testcase_27 AC 75 ms
74,932 KB
testcase_28 AC 72 ms
74,944 KB
testcase_29 AC 101 ms
76,820 KB
testcase_30 AC 1,019 ms
199,480 KB
testcase_31 AC 157 ms
82,216 KB
testcase_32 AC 1,417 ms
192,956 KB
testcase_33 AC 1,729 ms
183,744 KB
testcase_34 AC 78 ms
75,532 KB
testcase_35 AC 73 ms
74,932 KB
testcase_36 AC 111 ms
79,832 KB
testcase_37 AC 116 ms
82,412 KB
testcase_38 AC 1,307 ms
277,388 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={(F,0,0):1 for F in range(1,S+1)}
def f(F,R,L):
    """
    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]:
        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