結果
問題 | No.472 平均順位 |
ユーザー |
|
提出日時 | 2019-01-16 21:23:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,145 bytes |
コンパイル時間 | 926 ms |
コンパイル使用メモリ | 77,860 KB |
実行使用メモリ | 601,600 KB |
最終ジャッジ日時 | 2024-06-28 16:58:17 |
合計ジャッジ時間 | 15,047 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 4 |
other | MLE * 16 |
ソースコード
#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <set>#include <vector>#include <map>#include <list>#include <stack>#include <cstdio>#include <cstring>#include <cstdlib>#include <queue>#define mkp make_pair#define fi first#define se second#define pt(num) cout << num << "\n"#define max(a, b) ((a)>(b) ? (a):(b))#define min(a, b) ((a)<(b) ? (a):(b))#define chmax(a, b) (a<b ? a=b : 0)#define chmin(a, b) (a>b ? a=b : 0)#define INF 1000000000000000000#define MOD 1000000007LL#define MAX 101010using namespace std;typedef long long ll;typedef pair<ll, ll> P;typedef map<ll, ll> Map;int main(void) {ll N, P;cin >> N >> P;ll i, j;ll a[5050], b[5050], c[5050];ll dp[5050][5050*3]={};for(i=0; i<N; i++) {cin >> a[i] >> b[i] >> c[i];}for(i=0; i<N; i++) {for(j=0; j<=P; j++) {chmin(dp[i+1][j], dp[i][j]+a[i]);chmin(dp[i+1][j+1], dp[i][j]+b[i]);chmin(dp[i+1][j+2], dp[i][j]+c[i]);chmin(dp[i+1][j+3], dp[i][j]+1);}}pt((double)(dp[N][P])/N);}