Submission #922305

#TimeUsernameProblemLanguageResultExecution timeMemory
92230512345678Cipele (COCI18_cipele)C++17
90 / 90
35 ms3028 KiB
#include <bits/stdc++.h> using namespace std; int n, m; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>m; vector<int> a(n), b(m); for (auto &x:a) cin>>x; for (auto &x:b) cin>>x; sort(a.begin(), a.end()); sort(b.begin(), b.end()); if (n>m) swap(n, m), swap(a, b); int l=0, r=1e9; while (l<r) { int md=(l+r)/2, can=1, idx=0; for (int i=0; i<n; i++) { while (idx<m&&abs(b[idx]-a[i])>md) idx++; if (idx>=m) can=0; else idx++; } if (can) r=md; else l=md+1; } cout<<l; }
#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...