Submission #158779

#TimeUsernameProblemLanguageResultExecution timeMemory
158779a_playerCipele (COCI18_cipele)C++14
90 / 90
163 ms1912 KiB
#include <bits/stdc++.h> using namespace std; int N,M; int r[200001]; int l[200001]; bool check(int T){ int a=0; for(int i=0;i<N;i++){ while(abs(l[a]-r[i])>T&&a<M)a++; if(a==M)return false; a++; } return true; } int main() { cin>>N>>M; for(int i=0;i<N;i++)cin>>r[i]; for(int i=0;i<M;i++)cin>>l[i]; if(N>M){ swap(N,M); swap(r,l); } sort(r,r+N); sort(l,l+M); int x=-1; for(int b=1e9+1;b>=1;b/=2) while(!check(x+b))x+=b; cout<<x+1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...