#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
signed main(){
ios_base::sync_with_stdio();
cin.tie(0);cout.tie(0);
int n;
cin>>n;
vector <int> a(n+1),b(n);
for(int i=0;i<=n;i++){
cin>>a[i];
}
for(int i=0;i<n;i++)cin>>b[i];
sort(all(b));
for(int i=0;i<=n;i++){
vector <int> v;
for(int j=0;j<=n;j++){
if(j!=i)v.pb(a[j]);
}
sort(all(v));
int mx=0;
for(int j=0;j<n;j++){
mx=max(v[j]-b[j],mx);
}
cout<<mx<<" ";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
21 ms |
348 KB |
Output is correct |
15 |
Correct |
72 ms |
592 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
124 ms |
508 KB |
Output is correct |
18 |
Correct |
90 ms |
504 KB |
Output is correct |
19 |
Correct |
92 ms |
512 KB |
Output is correct |
20 |
Correct |
91 ms |
504 KB |
Output is correct |
21 |
Correct |
96 ms |
500 KB |
Output is correct |
22 |
Correct |
89 ms |
348 KB |
Output is correct |
23 |
Correct |
90 ms |
344 KB |
Output is correct |
24 |
Correct |
99 ms |
496 KB |
Output is correct |
25 |
Correct |
146 ms |
344 KB |
Output is correct |
26 |
Correct |
124 ms |
508 KB |
Output is correct |
27 |
Correct |
121 ms |
504 KB |
Output is correct |
28 |
Correct |
135 ms |
344 KB |
Output is correct |
29 |
Correct |
101 ms |
344 KB |
Output is correct |
30 |
Correct |
122 ms |
504 KB |
Output is correct |
31 |
Correct |
141 ms |
344 KB |
Output is correct |
32 |
Correct |
156 ms |
508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
21 ms |
348 KB |
Output is correct |
15 |
Correct |
72 ms |
592 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
124 ms |
508 KB |
Output is correct |
18 |
Correct |
90 ms |
504 KB |
Output is correct |
19 |
Correct |
92 ms |
512 KB |
Output is correct |
20 |
Correct |
91 ms |
504 KB |
Output is correct |
21 |
Correct |
96 ms |
500 KB |
Output is correct |
22 |
Correct |
89 ms |
348 KB |
Output is correct |
23 |
Correct |
90 ms |
344 KB |
Output is correct |
24 |
Correct |
99 ms |
496 KB |
Output is correct |
25 |
Correct |
146 ms |
344 KB |
Output is correct |
26 |
Correct |
124 ms |
508 KB |
Output is correct |
27 |
Correct |
121 ms |
504 KB |
Output is correct |
28 |
Correct |
135 ms |
344 KB |
Output is correct |
29 |
Correct |
101 ms |
344 KB |
Output is correct |
30 |
Correct |
122 ms |
504 KB |
Output is correct |
31 |
Correct |
141 ms |
344 KB |
Output is correct |
32 |
Correct |
156 ms |
508 KB |
Output is correct |
33 |
Execution timed out |
1014 ms |
10712 KB |
Time limit exceeded |
34 |
Halted |
0 ms |
0 KB |
- |