# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
84396 | wzy | Cipele (COCI18_cipele) | C++11 | 925 ms | 16396 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;
int n , m;
vector<int> small, big;
int32_t main(){
scanf("%d%d" , &n , &m);
small.resize(n) , big.resize(m);
for(int i = 0 ; i < n ;i ++){
scanf("%d" , &small[i]);
}
for(int i = 0 ; i < m ; i++){
scanf("%d" , &big[i]);
}
sort(small.begin() , small.end());
sort(big.begin() , big.end());
int l = 0 , r = 1000000000;
if(small.size() > big.size()) swap(n,m) , swap(small , big);
int ansj = -1;
while(l<=r){
int mid = (l+r)/2;
int can = true;
multiset<int> mt;
for(int i = 0 ; i < big.size() ; i++) mt.insert(big[i]);
for(int i = 0 ; i < small.size() ; i++){
multiset<int>::iterator it = mt.lower_bound(small[i] - mid);
if(it == mt.end()){
can = false;
break;
Compilation message (stderr)
# | 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... |