結果
| 問題 | No.472 平均順位 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-12 15:20:19 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 533 bytes |
| 記録 | |
| コンパイル時間 | 2,291 ms |
| コンパイル使用メモリ | 129,424 KB |
| 実行使用メモリ | 304,620 KB |
| 最終ジャッジ日時 | 2026-03-05 18:00:03 |
| 合計ジャッジ時間 | 5,351 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 MLE * 3 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string;
void main()
{
auto rd = readln.split.to!(int[]), n = rd[0], p = rd[1];
auto r = new int[][](n, 4);
foreach (i; 0..n) r[i] = readln.split.to!(int[]) ~ 1;
auto inf = 10^^9;
auto dp = new int[][](n+1, p+1);
foreach (i; 0..n+1) dp[i][] = inf;
dp[0][0] = 0;
foreach (i; 0..n)
foreach (j; 0..p+1)
foreach (k; 0..4)
if (j-k >= 0)
dp[i+1][j] = min(dp[i+1][j], dp[i][j-k] + r[i][k]);
writefln("%.6f", dp[n][p].to!real / n);
}