#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
#define MAXN 200005
int n;
int a[MAXN], b[MAXN];
int main () {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
for (int i=0; i<=n; i++) {
cin >> a[i];
}
sort(a, a+n+1);
for (int i=0; i<n; i++) {
cin >> b[i];
}
sort(b, b+n);
multiset<int> cur;
for (int i=1; i<=n; i++) {
cur.insert(max(0, a[i]-b[i-1]));
}
cout << *prev(cur.end()) << " ";
for (int i=0; i<n; i++) {
cur.erase(cur.find(max(0, a[i+1]-b[i])));
cur.insert(max(0, a[i]-b[i]));
cout << *prev(cur.end()) << " ";
}
cout << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |