#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 = 0;
for(int j = 0; j<n; j++){
ans = max(ans,max(0ll,v1[j] - b[j]));
}
cout<<ans<<" ";
}
cout<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |