Submission #1090923

#TimeUsernameProblemLanguageResultExecution timeMemory
1090923LucaIlieCipele (COCI18_cipele)C++17
90 / 90
66 ms4180 KiB
#include <bits/stdc++.h> using namespace std; const int MAX_N = 3e5; const int MAX_K = 1e9; int f[MAX_N], b[MAX_N]; int main() { int n, m; cin >> n >> m; for ( int i = 0; i < n; i++ ) cin >> f[i]; sort( f, f + n ); for ( int i = 0; i < m; i++ ) cin >> b[i]; sort( b, b + m ); if ( n > m ) { swap( n, m ); swap( f, b ); } int st = -1, dr = MAX_K; while ( dr - st > 1 ) { int k = (st + dr) / 2; int j = 0; for ( int i = 0; i < n; i++ ) { while ( j < m && abs( f[i] - b[j] ) > k ) j++; j++; } if ( j <= m ) dr = k; else st = k; } cout << dr << "\n"; 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...