結果

問題 No.1111 コード進行
ユーザー 夜
提出日時 2020-08-02 03:48:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 859 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 91,240 KB
実行使用メモリ 235,904 KB
最終ジャッジ日時 2023-09-23 03:49:02
合計ジャッジ時間 4,757 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 4 ms
5,644 KB
testcase_07 WA -
testcase_08 AC 5 ms
6,448 KB
testcase_09 WA -
testcase_10 AC 4 ms
5,312 KB
testcase_11 AC 4 ms
5,328 KB
testcase_12 WA -
testcase_13 AC 4 ms
5,184 KB
testcase_14 WA -
testcase_15 AC 5 ms
6,748 KB
testcase_16 WA -
testcase_17 AC 3 ms
4,620 KB
testcase_18 AC 2 ms
4,608 KB
testcase_19 AC 2 ms
4,384 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 3 ms
4,928 KB
testcase_22 AC 5 ms
6,392 KB
testcase_23 AC 4 ms
5,984 KB
testcase_24 AC 3 ms
4,592 KB
testcase_25 WA -
testcase_26 AC 4 ms
5,452 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 7 ms
7,548 KB
testcase_29 AC 18 ms
17,360 KB
testcase_30 AC 16 ms
13,664 KB
testcase_31 AC 3 ms
4,720 KB
testcase_32 AC 26 ms
20,140 KB
testcase_33 AC 21 ms
13,224 KB
testcase_34 AC 6 ms
6,844 KB
testcase_35 AC 10 ms
9,584 KB
testcase_36 AC 133 ms
111,980 KB
testcase_37 AC 97 ms
91,068 KB
testcase_38 AC 50 ms
45,932 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 28 ms
26,744 KB
testcase_42 AC 108 ms
98,268 KB
testcase_43 AC 64 ms
56,160 KB
testcase_44 AC 32 ms
31,392 KB
testcase_45 AC 54 ms
50,344 KB
testcase_46 AC 21 ms
19,948 KB
testcase_47 AC 65 ms
20,624 KB
testcase_48 AC 234 ms
235,828 KB
testcase_49 AC 236 ms
235,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long dp[330][330][330];
long long p[330], q[330], c[330];
int main() {
	int n, m, k;
	cin >> n >> m >> k;
	for (int i = 1; i <= m; i++) {
		cin >> p[i] >> q[i] >> c[i];
	}
	for (int i = 1; i <= 300; i++) {
		dp[0][i][0] = 1;
	}
	for (int i = 1; i < n; i++) {
		for (int j = 1; j <= m; j++) {
			for (int l = 0; l <= k; l++) {
				dp[i][q[j]][l+c[j]] += dp[i - 1][p[j]][l];
				dp[i][q[j]][l + c[j]] %= 1000000007;
			}
		}
	}
	long long ans = 0;
	for (int i = 0; i <= 300; i++) {
		ans += dp[n - 1][i][k];
		ans %= 1000000007;
	}
	cout << ans << endl;
	return 0;
}

0