#include <bits/stdc++.h>
using namespace std;
const int mxsz = 2e5 + 7;
int n, a[mxsz], b[mxsz];
priority_queue<int> q;
int main () {
cin >> n;
for (int i = 1; i <= n+1; i++) {
cin >> a[i];
}
for (int j = 1; j <= n; j++) {
cin >> b[j];
}
sort(a+1, a+n+1+1);
sort(b+1, b+n+1);
reverse(b+1, b+n+1);
int r = n+1;
for (int i = 1; i <= n; i++) {
q.push(a[r--] - b[i]);
}
r = n;
for (int i = 1; i <= n+1; i++) {
cout << q.top() << ' ';
q.pop();
q.push(a[i] - b[r--]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |