Submission #2531736
Source Code Expand
#include<iostream> #include<string> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> #include<vector> #include<functional> #include<iomanip> #include<queue> #include<cassert> #include<tuple> #include<set> #include<map> #include<list> #include<bitset> #define PB push_back #define ALL(a) (a).begin(),(a).end() #define DWN(a) (a).begin(),(a).end(), greater<int>() #define rep(i, m) for (int i = 0; i < m; i++) #define REP(i, n, m) for (int i = n; i < m; i++) #define mod 1000000007 using namespace std; typedef long long ll; typedef pair<int, int> P; const int dx[4] = { 1, 0, -1, 0 }; const int dy[4] = { 0, 1, 0, -1 }; const int INF = (int)1e9; int main() { int n; cin >> n; int t[110]; double v[110]; rep(i, n) { cin >> t[i] >> v[i]; t[i] *= 2; } double max_v[210]; rep(i, 210) max_v[i] = INF; int cur = 0; rep(i, n) { REP(j, cur, cur + t[i] + 1) { max_v[j] = min(max_v[j], v[i]); } cur += t[i]; } max_v[0] = 0, max_v[cur] = 0; for (int i = 0; i < cur - 1; i++) { max_v[i + 1] = min(max_v[i + 1], max_v[i] + 0.5); } for (int i = cur - 1; i >= 0; i--) { max_v[i] = min(max_v[i], max_v[i + 1] + 0.5); } double ans = 0.0; rep(i, cur) { ans += max_v[i] + max_v[i + 1]; } cout << ans * 0.25 << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - AtCoder Express |
User | tako_39 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1342 Byte |
Status | RE |
Exec Time | 99 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt, s4.txt, s5.txt |
All | in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in20.txt, in21.txt, in22.txt, in23.txt, in24.txt, in25.txt, in26.txt, in27.txt, in28.txt, in29.txt, in30.txt, in31.txt, in32.txt, in33.txt, in34.txt, in35.txt, s1.txt, s2.txt, s3.txt, s4.txt, s5.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | RE | 97 ms | 256 KB |
in02.txt | RE | 98 ms | 256 KB |
in03.txt | RE | 97 ms | 256 KB |
in04.txt | RE | 97 ms | 256 KB |
in05.txt | RE | 97 ms | 256 KB |
in06.txt | RE | 99 ms | 256 KB |
in07.txt | RE | 97 ms | 256 KB |
in08.txt | RE | 98 ms | 256 KB |
in09.txt | RE | 97 ms | 256 KB |
in10.txt | RE | 97 ms | 256 KB |
in11.txt | RE | 97 ms | 256 KB |
in12.txt | RE | 96 ms | 256 KB |
in13.txt | RE | 97 ms | 256 KB |
in14.txt | RE | 96 ms | 256 KB |
in15.txt | AC | 1 ms | 256 KB |
in16.txt | RE | 98 ms | 256 KB |
in17.txt | RE | 97 ms | 256 KB |
in18.txt | RE | 97 ms | 256 KB |
in19.txt | AC | 1 ms | 256 KB |
in20.txt | RE | 97 ms | 256 KB |
in21.txt | RE | 98 ms | 256 KB |
in22.txt | RE | 98 ms | 256 KB |
in23.txt | WA | 1 ms | 256 KB |
in24.txt | RE | 97 ms | 256 KB |
in25.txt | RE | 97 ms | 256 KB |
in26.txt | RE | 97 ms | 256 KB |
in27.txt | RE | 97 ms | 256 KB |
in28.txt | AC | 1 ms | 256 KB |
in29.txt | AC | 1 ms | 256 KB |
in30.txt | AC | 1 ms | 256 KB |
in31.txt | RE | 97 ms | 256 KB |
in32.txt | RE | 96 ms | 256 KB |
in33.txt | RE | 97 ms | 256 KB |
in34.txt | RE | 97 ms | 256 KB |
in35.txt | WA | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | WA | 1 ms | 256 KB |
s3.txt | WA | 1 ms | 256 KB |
s4.txt | AC | 1 ms | 256 KB |
s5.txt | RE | 97 ms | 256 KB |