이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
int n;
cin >> n;
vector<int> a(n + 1), b(n);
for (int i = 0; i < n + 1; i++) {
cin >> a[i];
}
for (int j = 0; j < n; j++) {
cin >> b[j];
}
sort(b.begin(), b.end());
vector<int> ans;
for (int i = 0; i < n + 1; i++) {
vector <int> v;
for(int j = 0 ; j < n + 1; j++){
if(i == j){
continue;
}
else{
v.push_back(a[j]);
}
}
sort(v.begin() , v.end());
int mn = 0;
for(int j = 0 ; j < n; j++){
mn = max(mn , abs(v[j] - b[j]));
}
ans.push_back(mn);
}
for(auto x : ans){
cout << x << " ";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |