# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
894302 |
2023-12-28T04:20:10 Z |
vjudge1 |
Cipele (COCI18_cipele) |
C++17 |
|
33 ms |
2896 KB |
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <functional>
#include <complex>
#include <climits>
#include <random>
using namespace std;
#define ll long long
#define pb push_back
#define ull unsigned long long
#define F first
#define S second
#define all(v) v.begin(), v.end()
const int INF = INT_MAX;
int a[200001], n, m;
int b[200001];
bool bruh(ll x){
for(int l = 1, r = 1; l <= n; l++, r++){
while(r <= m && abs(b[r] - a[l]) > x) r++;
if(r > m) return 0;
}
return 1;
}
void solve(){
cin >> n >> m;
for(int i = 1; i <= n; i++) cin >> a[i];
for(int i = 1; i <= m; i++) cin >> b[i];
if(n > m){
swap(a, b), swap(n, m);
}
sort(a + 1, a + 1 + n), sort(b + 1, b + 1 + m);
ll l = -1, r = 2e9;
while(r - l > 1){
ll mid = (l + r) / 2;
if(bruh(mid)) r = mid;
else l = mid;
}
cout << r;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
int xach = 1;
//cin >> xach;
while(xach--) solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
2128 KB |
Output is correct |
2 |
Correct |
31 ms |
2524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
2396 KB |
Output is correct |
2 |
Correct |
31 ms |
2508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
604 KB |
Output is correct |
2 |
Correct |
2 ms |
472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
1884 KB |
Output is correct |
2 |
Correct |
20 ms |
2792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
2416 KB |
Output is correct |
2 |
Correct |
15 ms |
2648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
1884 KB |
Output is correct |
2 |
Correct |
29 ms |
2896 KB |
Output is correct |