結果

問題 No.1449 新プロランド
ユーザー yuruhiyayuruhiya
提出日時 2021-03-31 20:26:56
言語 cLay
(20240104-1)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 3,493 ms
コンパイル使用メモリ 178,812 KB
実行使用メモリ 14,228 KB
最終ジャッジ日時 2023-08-25 16:50:57
合計ジャッジ時間 4,269 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,504 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 19 ms
14,228 KB
testcase_06 AC 11 ms
10,692 KB
testcase_07 AC 8 ms
9,832 KB
testcase_08 AC 14 ms
13,160 KB
testcase_09 AC 9 ms
8,368 KB
testcase_10 AC 9 ms
10,408 KB
testcase_11 AC 7 ms
10,024 KB
testcase_12 AC 12 ms
10,968 KB
testcase_13 AC 8 ms
8,028 KB
testcase_14 AC 6 ms
10,060 KB
testcase_15 AC 13 ms
10,944 KB
testcase_16 AC 9 ms
8,100 KB
testcase_17 AC 10 ms
10,304 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 4 ms
7,344 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 7 ms
10,024 KB
testcase_22 AC 3 ms
4,376 KB
testcase_23 AC 10 ms
13,004 KB
testcase_24 AC 7 ms
7,540 KB
testcase_25 AC 3 ms
4,584 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 19 ms
14,028 KB
testcase_28 AC 13 ms
11,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

{
	int @n, @m;
	int a[201], b[]; ll 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 MAX_C = 1003, A[MAX_C*m*2], B[], k=0; ll C[];
	rep(i, m*2) rep(s, 1, MAX_C) {
		A[k] = a[i]*MAX_C+s;
		B[k] = b[i]*MAX_C+min(MAX_C-1, s+t[b[i]]);
		C[k++] = c[i]/s+t[b[i]];
	}

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