# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707078 | TAhmed33 | Cipele (COCI18_cipele) | C++98 | 127 ms | 3648 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, m;
int arr[100001] = {};
int arr2[100001] = {};
bool check (int x) {
int pos = 1;
for (int i = 1; i <= n; i++) {
int q = lower_bound(arr2 + pos, arr2 + m + 1, arr[i] - x) - arr2;
if (q == m + 1) return false;
if (abs(arr2[q] - arr[i]) > x) return false;
pos = q + 1;
}
return true;
}
signed main () {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> arr[i];
}
for (int j = 1; j <= m; j++) {
cin >> arr2[j];
}
sort(arr + 1, arr + n + 1);
sort(arr2 + 1, arr2 + m + 1);
if (n > m) {
swap(n, m);
for (int i = 1; i <= 100000; i++) swap(arr[i], arr2[i]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |