結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 22:10:25
言語 PyPy3
(7.3.13)
結果
TLE  
実行時間 -
コード長 543 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 281,652 KB
最終ジャッジ日時 2023-08-01 21:55:39
合計ジャッジ時間 16,362 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
79,384 KB
testcase_01 AC 78 ms
74,984 KB
testcase_02 AC 74 ms
74,916 KB
testcase_03 AC 73 ms
74,848 KB
testcase_04 AC 72 ms
74,844 KB
testcase_05 AC 74 ms
74,952 KB
testcase_06 AC 306 ms
94,880 KB
testcase_07 AC 1,587 ms
181,720 KB
testcase_08 TLE -
testcase_09 AC 92 ms
75,944 KB
testcase_10 AC 1,094 ms
179,024 KB
testcase_11 AC 616 ms
121,140 KB
testcase_12 AC 518 ms
104,480 KB
testcase_13 AC 85 ms
75,940 KB
testcase_14 AC 1,803 ms
162,224 KB
testcase_15 AC 639 ms
162,964 KB
testcase_16 AC 612 ms
129,316 KB
testcase_17 AC 313 ms
103,348 KB
testcase_18 AC 74 ms
74,940 KB
testcase_19 AC 74 ms
74,848 KB
testcase_20 AC 76 ms
75,352 KB
testcase_21 AC 611 ms
123,336 KB
testcase_22 AC 74 ms
75,040 KB
testcase_23 AC 364 ms
111,084 KB
testcase_24 AC 211 ms
87,336 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
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]:
        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