# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134246 | 2019-07-22T09:14:13 Z | reda | Meetings (IOI18_meetings) | C++14 | 5500 ms | 1208 KB |
#include<bits/stdc++.h> using namespace std ; #define pb push_back #define ll long long #define ld long double #define mp make_pair #define MOD 1000000007 #define endl '\n' #pragma GCC optimize ("O3") #include "meetings.h" #define MAXN 105 vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R){ ll n = (int)H.size(); vector<long long> ret; for(int i = 0; i < (int)L.size(); i++){ int l = L[i], r = R[i]; long long ans = 1e18; for(int j = l; j <= r; j++){ long long curr = 0; long long mx = 0; for(int k = j; k <= r; k++){ mx = max(mx, (long long)H[k]); curr += mx; } mx = H[j]; for(int k = j - 1; k >= l; k--){ mx = max(mx, (long long)H[k]); curr += mx; } ans = min(ans, curr); } ret.push_back(ans); } return ret; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Correct | 17 ms | 388 KB | Output is correct |
3 | Correct | 92 ms | 380 KB | Output is correct |
4 | Correct | 30 ms | 420 KB | Output is correct |
5 | Correct | 92 ms | 380 KB | Output is correct |
6 | Correct | 11 ms | 392 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 5 ms | 376 KB | Output is correct |
9 | Correct | 91 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Correct | 17 ms | 388 KB | Output is correct |
3 | Correct | 92 ms | 380 KB | Output is correct |
4 | Correct | 30 ms | 420 KB | Output is correct |
5 | Correct | 92 ms | 380 KB | Output is correct |
6 | Correct | 11 ms | 392 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 5 ms | 376 KB | Output is correct |
9 | Correct | 91 ms | 384 KB | Output is correct |
10 | Execution timed out | 5505 ms | 504 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Execution timed out | 5571 ms | 1208 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Execution timed out | 5571 ms | 1208 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Correct | 17 ms | 388 KB | Output is correct |
3 | Correct | 92 ms | 380 KB | Output is correct |
4 | Correct | 30 ms | 420 KB | Output is correct |
5 | Correct | 92 ms | 380 KB | Output is correct |
6 | Correct | 11 ms | 392 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 5 ms | 376 KB | Output is correct |
9 | Correct | 91 ms | 384 KB | Output is correct |
10 | Execution timed out | 5505 ms | 504 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |