結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 22:09:20
言語 PyPy3
(7.3.13)
結果
TLE  
実行時間 -
コード長 579 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 230,876 KB
最終ジャッジ日時 2023-08-01 21:54:51
合計ジャッジ時間 18,119 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,112 KB
testcase_01 AC 75 ms
75,060 KB
testcase_02 AC 75 ms
74,988 KB
testcase_03 AC 74 ms
74,948 KB
testcase_04 AC 75 ms
74,924 KB
testcase_05 AC 75 ms
74,848 KB
testcase_06 AC 316 ms
94,884 KB
testcase_07 AC 1,639 ms
181,652 KB
testcase_08 TLE -
testcase_09 AC 93 ms
76,004 KB
testcase_10 AC 1,111 ms
179,040 KB
testcase_11 AC 621 ms
121,272 KB
testcase_12 AC 529 ms
104,456 KB
testcase_13 AC 85 ms
76,048 KB
testcase_14 AC 1,912 ms
162,220 KB
testcase_15 AC 660 ms
163,216 KB
testcase_16 AC 638 ms
129,664 KB
testcase_17 AC 323 ms
103,900 KB
testcase_18 AC 74 ms
74,780 KB
testcase_19 AC 74 ms
74,944 KB
testcase_20 AC 76 ms
75,260 KB
testcase_21 AC 649 ms
123,348 KB
testcase_22 AC 73 ms
74,940 KB
testcase_23 AC 369 ms
111,108 KB
testcase_24 AC 216 ms
87,224 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
P=[0]*(M+1)
Q=[0]*(M+1)
C=[0]*(M+1)

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