#include <bits/stdc++.h>
using namespace std;
int neckties[200'005];
int employees[200'005];
int strangeness[200'005];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n;
cin >> n;
for (int i = 0; i <= n; i++)
{
cin >> neckties[i];
}
for (int i = 0; i < n; i++)
{
cin >> employees[i];
}
sort (neckties, neckties + n + 1);
sort (employees, employees + n);
for (int i = n+1; i > 0; i--)
{
strangeness[i] = max(strangeness[i+1], neckties[i] - employees[i-1]);
}
int str = 0;
for (int i = 0; i <= n; i++)
{
cout << max (str, strangeness[i+1]) << ' ';
str = max(str, neckties[i] - employees[i]);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2388 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2388 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2388 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |