結果

問題 No.1111 コード進行
ユーザー 👑 KazunKazun
提出日時 2020-07-10 22:05:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 1,167 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 276,576 KB
最終ジャッジ日時 2023-08-01 18:01:44
合計ジャッジ時間 7,448 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
75,104 KB
testcase_01 AC 68 ms
74,868 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 WA -
testcase_10 AC 1,316 ms
191,992 KB
testcase_11 AC 904 ms
138,308 KB
testcase_12 WA -
testcase_13 AC 89 ms
76,280 KB
testcase_14 TLE -
testcase_15 AC 750 ms
178,132 KB
testcase_16 AC 907 ms
157,292 KB
testcase_17 AC 335 ms
108,788 KB
testcase_18 AC 71 ms
75,112 KB
testcase_19 AC 68 ms
75,088 KB
testcase_20 AC 84 ms
76,236 KB
testcase_21 AC 782 ms
132,816 KB
testcase_22 AC 71 ms
75,288 KB
testcase_23 AC 479 ms
127,260 KB
testcase_24 AC 267 ms
92,316 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))%A
print((V*500000004)%A)
0