# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954718 | 2024-03-28T12:26:01 Z | LucaIlie | Measures (CEOI22_measures) | C++17 | 1500 ms | 3268 KB |
#include <bits/stdc++.h> using namespace std; vector<int> v; int main() { int n, q, d; cin >> n >> q >> d; for ( int i = 0; i < n; i++ ) { int p; cin >> p; v.push_back( p ); } for ( int i = 0; i < q; i++ ) { int p; cin >> p; v.push_back( p ); sort( v.begin(), v.end() ); long long ans = 0; for ( int l = 0; l < v.size(); l++ ) { for ( int r = l + 1; r < v.size(); r++ ) ans = max( ans, (long long)d * (r - l) - (v[r] - v[l]) ); } cout << ans / 2; if ( ans % 2 == 1 ) cout << ".5"; cout << " "; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 344 KB | Output is correct |
2 | Correct | 22 ms | 600 KB | Output is correct |
3 | Correct | 21 ms | 448 KB | Output is correct |
4 | Correct | 22 ms | 468 KB | Output is correct |
5 | Correct | 21 ms | 344 KB | Output is correct |
6 | Correct | 20 ms | 344 KB | Output is correct |
7 | Correct | 20 ms | 348 KB | Output is correct |
8 | Correct | 20 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 344 KB | Output is correct |
2 | Correct | 22 ms | 600 KB | Output is correct |
3 | Correct | 21 ms | 448 KB | Output is correct |
4 | Correct | 22 ms | 468 KB | Output is correct |
5 | Correct | 21 ms | 344 KB | Output is correct |
6 | Correct | 20 ms | 344 KB | Output is correct |
7 | Correct | 20 ms | 348 KB | Output is correct |
8 | Correct | 20 ms | 348 KB | Output is correct |
9 | Execution timed out | 1525 ms | 3268 KB | Time limit exceeded |
10 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1551 ms | 472 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1551 ms | 472 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |