結果

問題 No.1449 新プロランド
ユーザー yuruhiyayuruhiya
提出日時 2021-03-31 20:30:51
言語 cLay
(20240104-1)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 2,939 ms
コンパイル使用メモリ 179,240 KB
実行使用メモリ 13,172 KB
最終ジャッジ日時 2023-08-25 16:51:00
合計ジャッジ時間 4,261 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 16 ms
13,172 KB
testcase_06 AC 11 ms
10,016 KB
testcase_07 AC 6 ms
7,396 KB
testcase_08 AC 11 ms
10,484 KB
testcase_09 AC 8 ms
7,852 KB
testcase_10 AC 7 ms
9,764 KB
testcase_11 AC 6 ms
9,672 KB
testcase_12 AC 10 ms
10,392 KB
testcase_13 AC 8 ms
7,492 KB
testcase_14 AC 5 ms
9,368 KB
testcase_15 AC 11 ms
10,164 KB
testcase_16 AC 8 ms
7,608 KB
testcase_17 AC 9 ms
9,932 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 3 ms
6,836 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 6 ms
9,568 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 8 ms
10,188 KB
testcase_24 AC 6 ms
7,300 KB
testcase_25 AC 3 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 17 ms
12,996 KB
testcase_28 AC 11 ms
8,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

{
	int @n, @m, a[201], b[], c[], t[];
	rd((a--, b--, c)(m), t(n));
	rep(i, m) a[i + m] = b[i], b[i + m] = a[i], c[i + m] = c[i];

	int M = 1003, A[M * m * 2], B[], C[], k = 0;
	rep(i, m * 2) rep(s, 1, M) {
		A[k] = a[i] * M + s;
		B[k] = b[i] * M + min(M - 1, s + t[b[i]]);
		C[k++] = c[i] / s + t[b[i]];
	}

	wgraph<int> g;
	g.setDirectEdge(M * n, k, A, B, C);
	int dist[M * n], ans = 1d9;
	g.getDist(t[0], dist, 1d9);
	rep(s, M) ans <?= dist[~-n * M + s];
	wt(ans + t[0]);
}
0