#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll n,m;cin>>n>>m;
vector<ll>a,b;
for(ll i=0;i<n;i++){
ll k;cin>>k;
a.push_back(k);
}
for(ll i=0;i<m;i++){
ll k;cin>>k;
b.push_back(k);
}
if(n>m)swap(a,b);
map<ll,bool>vis;
ll ans=0;
for(ll i=0;i<n;i++){
ll mn=1e18;
ll idx=0;
for(ll j=0;j<m;j++){
if(vis[j])continue;
ll y=abs(a[i]-b[j]);
if(y<mn){
mn=y;
idx=j;
}
}
vis[idx]=1;
ans=max(ans,mn);
}
cout<<ans<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
8128 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
8048 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
280 ms |
460 KB |
Output is correct |
2 |
Execution timed out |
1088 ms |
716 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
29 ms |
588 KB |
Output is correct |
2 |
Execution timed out |
1081 ms |
588 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1100 ms |
588 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1018 ms |
680 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1093 ms |
588 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1092 ms |
7748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1077 ms |
7488 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1089 ms |
7232 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |