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