結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
79,800 KB
testcase_01 AC 74 ms
74,748 KB
testcase_02 AC 73 ms
74,872 KB
testcase_03 AC 72 ms
74,904 KB
testcase_04 AC 71 ms
74,764 KB
testcase_05 AC 70 ms
74,896 KB
testcase_06 AC 82 ms
75,884 KB
testcase_07 AC 86 ms
75,924 KB
testcase_08 AC 72 ms
74,832 KB
testcase_09 AC 86 ms
76,136 KB
testcase_10 AC 71 ms
74,900 KB
testcase_11 AC 72 ms
74,896 KB
testcase_12 AC 118 ms
77,980 KB
testcase_13 AC 71 ms
74,704 KB
testcase_14 AC 152 ms
81,348 KB
testcase_15 AC 73 ms
74,904 KB
testcase_16 AC 84 ms
76,088 KB
testcase_17 AC 72 ms
75,004 KB
testcase_18 AC 71 ms
74,832 KB
testcase_19 AC 70 ms
74,960 KB
testcase_20 AC 70 ms
74,596 KB
testcase_21 AC 68 ms
75,004 KB
testcase_22 AC 69 ms
74,964 KB
testcase_23 AC 73 ms
74,948 KB
testcase_24 AC 77 ms
75,816 KB
testcase_25 AC 131 ms
81,384 KB
testcase_26 AC 198 ms
83,452 KB
testcase_27 AC 69 ms
74,964 KB
testcase_28 AC 68 ms
74,844 KB
testcase_29 AC 91 ms
77,000 KB
testcase_30 AC 1,028 ms
199,052 KB
testcase_31 AC 155 ms
81,364 KB
testcase_32 AC 1,437 ms
192,604 KB
testcase_33 AC 1,795 ms
183,892 KB
testcase_34 AC 79 ms
75,904 KB
testcase_35 AC 70 ms
74,832 KB
testcase_36 AC 98 ms
78,980 KB
testcase_37 AC 104 ms
82,888 KB
testcase_38 AC 1,344 ms
277,444 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):
    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