結果

問題 No.1111 コード進行
ユーザー gingin
提出日時 2020-07-17 21:08:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 759 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2024-05-07 05:41:54
合計ジャッジ時間 10,812 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
10,880 KB
testcase_01 AC 35 ms
10,880 KB
testcase_02 AC 33 ms
10,880 KB
testcase_03 AC 34 ms
10,752 KB
testcase_04 AC 33 ms
10,752 KB
testcase_05 AC 34 ms
10,752 KB
testcase_06 AC 36 ms
10,880 KB
testcase_07 AC 38 ms
10,752 KB
testcase_08 AC 36 ms
10,880 KB
testcase_09 AC 37 ms
10,880 KB
testcase_10 AC 34 ms
10,880 KB
testcase_11 AC 34 ms
10,880 KB
testcase_12 AC 44 ms
11,008 KB
testcase_13 AC 35 ms
10,880 KB
testcase_14 AC 70 ms
11,008 KB
testcase_15 AC 34 ms
10,880 KB
testcase_16 AC 36 ms
10,880 KB
testcase_17 AC 35 ms
10,752 KB
testcase_18 AC 33 ms
10,752 KB
testcase_19 AC 32 ms
10,880 KB
testcase_20 AC 33 ms
10,880 KB
testcase_21 AC 34 ms
10,880 KB
testcase_22 AC 34 ms
10,880 KB
testcase_23 AC 34 ms
10,880 KB
testcase_24 AC 33 ms
10,752 KB
testcase_25 AC 50 ms
10,880 KB
testcase_26 AC 115 ms
11,136 KB
testcase_27 AC 33 ms
10,752 KB
testcase_28 AC 42 ms
10,752 KB
testcase_29 AC 43 ms
10,752 KB
testcase_30 AC 770 ms
11,264 KB
testcase_31 AC 47 ms
10,880 KB
testcase_32 AC 1,475 ms
11,008 KB
testcase_33 AC 1,839 ms
11,520 KB
testcase_34 AC 40 ms
10,880 KB
testcase_35 AC 46 ms
10,880 KB
testcase_36 AC 43 ms
10,752 KB
testcase_37 AC 43 ms
10,880 KB
testcase_38 AC 718 ms
11,648 KB
testcase_39 TLE -
testcase_40 TLE -
testcase_41 AC 43 ms
11,008 KB
testcase_42 AC 49 ms
11,008 KB
testcase_43 AC 1,802 ms
12,672 KB
testcase_44 AC 37 ms
11,008 KB
testcase_45 AC 43 ms
11,008 KB
testcase_46 AC 82 ms
11,008 KB
testcase_47 AC 85 ms
10,880 KB
testcase_48 AC 89 ms
11,136 KB
testcase_49 AC 47 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N, M, K = list(map(int,input().split()))

    pqc = [[] * 301 for _ in range(301)]
    m = 10**9 + 7

    for _ in range(M):
        P, Q, C = map(int,input().split())
        pqc[P].append((Q,C))

    t = [{0:1} for _ in range(301)]
    for i in range(N-1):
        nt = [{} for _ in range(301)]
        for j in range(1,301):
            for k in t[j]:
                for q, c in pqc[j]:
                    v = k + c
                    if v <= K:
                        nt[q].setdefault(v, 0)
                        nt[q][v] += t[j][k]
                        nt[q][v] %= m
        t = nt

    result = 0
    for i in range(1,301):
        t[i].setdefault(K,0)
        result += t[i][K]
        result %= m

    print(result)

main()


0