結果
| 問題 |
No.472 平均順位
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-23 01:36:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 615 bytes |
| コンパイル時間 | 449 ms |
| コンパイル使用メモリ | 57,304 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-12-14 14:59:53 |
| 合計ジャッジ時間 | 22,678 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 TLE * 6 |
ソースコード
#include <iostream>
#include <vector>
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
using namespace std;
typedef long long int ll;
const int W = 150100;
int dp[2][W];
const int inf = 1e9;
int main(void){
int n, p;
cin >> n >> p;
REP(j, 0, W) {
dp[0][j] = inf;
}
dp[0][0] = 0;
REP(i, 1, n + 1) {
int t = i % 2;
int a[4];
REP(j, 0, 3) { cin >> a[j]; }
a[3] = 1;
REP(j, 0, W) {
int res = inf;
REP(k, 0, 4) {
if (j >= k) {
res = min(res, dp[1 - t][j - k] + a[k]);
}
}
dp[t][j] = res;
}
}
printf("%.15f\n", dp[n % 2][p] / 1.0 / n);
}