結果
問題 | No.472 平均順位 |
ユーザー |
![]() |
提出日時 | 2019-08-28 20:28:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,530 bytes |
コンパイル時間 | 1,486 ms |
コンパイル使用メモリ | 168,900 KB |
実行使用メモリ | 589,872 KB |
最終ジャッジ日時 | 2024-11-17 16:32:54 |
合計ジャッジ時間 | 4,328 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 MLE * 6 |
ソースコード
#include "bits/stdc++.h"using namespace std;typedef long long ll;typedef vector<ll> vll;#define int ll#define fi first#define se second#define SORT(a) sort(a.begin(),a.end())#define rep(i,n) for(int i = 0;i < (n) ; i++)#define REP(i,n) for(int i = 0;i < (n) ; i++)#define MP(a,b) make_pair(a,b)#define pb(a) push_back(a)#define INF LLONG_MAX/2#define all(x) (x).begin(),(x).end()#define debug(x) cerr<<#x<<": "<<x<<endl#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl//----------------------------------------------------------------// int MOD = 998244353;int MOD = 1000000007;ll dp[5001][15001] = {0};//----------------------------------------------------------------signed main(){ll n,p;cin >> n >> p;vll a(n),b(n),c(n);rep(i,n) cin >> a[i] >> b[i] >> c[i];for(int i = 0;i < n;i++){for(int j = 0;j <= p;j++){dp[i+1][j] = dp[i][j] + a[i];if(j >= 1) dp[i+1][j] = min(dp[i+1][j],dp[i][j-1]+b[i]);if(j >= 2) dp[i+1][j] = min(dp[i+1][j],dp[i][j-2]+c[i]);if(j >= 3) dp[i+1][j] = min(dp[i+1][j],dp[i][j-3]+1);}}// cout << dp[n][p]*1.0/n << endl;printf("%0.10lf\n",dp[n][p]*1.0/n);return 0;}//----------------------------------------------------------------// g++ -std=c++14 code1.cpp// rm -r -f test;oj dl https://code-festival-2018-quala.contest.atcoder.jp/tasks/code_festival_2018_quala_c// rm -r -f test;oj dl https://dp.contest.atcoder.jp/tasks/dp_a// rm -r -f test;oj dl https://abc054.contest.atcoder.jp/tasks/abc054_d