結果
問題 | No.472 平均順位 |
ユーザー |
|
提出日時 | 2019-01-16 21:25:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,164 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 78,208 KB |
実行使用メモリ | 590,592 KB |
最終ジャッジ日時 | 2024-06-28 16:59:18 |
合計ジャッジ時間 | 4,617 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 13 MLE * 3 |
ソースコード
#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[N+5], b[N+5], c[N+5];ll dp[N+5][P+5];memset(dp, 0, sizeof(dp));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);}