#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n; cin>>n;
vector<int> v(n+1); for(int& i : v) cin>>i;
vector<int> b(n); for(int& i : b) cin>>i;
sort(v.begin(),v.end()); sort(b.begin(),b.end());
for(int i = 0; i<=n; i++){
vector<int> v1;
for(int j = 0; j<=n; j++){
if(i == j) continue;
v1.push_back(v[j]);
}
int ans = LLONG_MAX;
do{
int x = 0;
for(int j = 0; j<n; j++) x = max(x,v1[j]-b[j]);
ans = min(ans,x);
}while(next_permutation(v1.begin(),v1.end()));
cout<<ans<<" ";
}
// cout<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
362 ms |
412 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
362 ms |
412 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
362 ms |
412 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |