#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
ios::sync_with_stdio(false), cin.tie(0);
int n, m, d;
cin >> n >> m >> d;
vector<int> points (n);
for (int i = 0; i < n; i++)
{
cin >> points[i];
}
for (int i = 0; i < m; i++)
{
int nouveau, reponse = 0;
cin >> nouveau;
points.push_back(nouveau);
sort(points.begin(), points.end());
for (int a = 0; a < (int)points.size(); a++)
{
for (int b = a+1; b < (int)points.size(); b++)
{
reponse = max(reponse, ((d * (b-a)) - (points[b] - points[a])));
}
}
cout << (reponse - reponse % 2) / 2;
if (reponse % 2) cout << ".5";
cout << ' ';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
340 KB |
Output is correct |
2 |
Correct |
22 ms |
356 KB |
Output is correct |
3 |
Correct |
24 ms |
356 KB |
Output is correct |
4 |
Correct |
23 ms |
360 KB |
Output is correct |
5 |
Correct |
24 ms |
356 KB |
Output is correct |
6 |
Correct |
23 ms |
340 KB |
Output is correct |
7 |
Correct |
22 ms |
356 KB |
Output is correct |
8 |
Correct |
22 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
340 KB |
Output is correct |
2 |
Correct |
22 ms |
356 KB |
Output is correct |
3 |
Correct |
24 ms |
356 KB |
Output is correct |
4 |
Correct |
23 ms |
360 KB |
Output is correct |
5 |
Correct |
24 ms |
356 KB |
Output is correct |
6 |
Correct |
23 ms |
340 KB |
Output is correct |
7 |
Correct |
22 ms |
356 KB |
Output is correct |
8 |
Correct |
22 ms |
340 KB |
Output is correct |
9 |
Execution timed out |
1564 ms |
3440 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1563 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1563 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |