Submission #699352

# Submission time Handle Problem Language Result Execution time Memory
699352 2023-02-16T16:12:58 Z Uniq0rn Cipele (COCI18_cipele) C++14
0 / 90
36 ms 1108 KB
#include <bits/stdc++.h> 
using namespace std; 
 
#define ll long long int 
#define ld long double
#define vi(x)  vector<x>
#define pb push_back
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()
 
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
int main()
{
    cin.tie(nullptr)->ios_base::sync_with_stdio(false);
    int n,m;cin >> n >> m;
    vector<int> a(n),b(m);
    for(auto &e:a) cin >> e;
    for(auto &e:b) cin >> e;
    sort(all(a),greater<int>());sort(all(b),greater<int>());
    if(n>m){
        swap(a,b);
        swap(n,m);
    }
    int l = 1,r = 10;
    while(l < r){
        int mid = (l+r)>>1;
        int p = 0,ok = 1,i;
        for(i=0;i<n;i++){
            while(p<m && abs(a[i]-b[p]) > mid) p++;
            if(p>m-1){
                ok = 0;
                break;
            }
            p++;
        }
        if(ok && i == n){
            r = mid;
        }
        else{
            l = mid+1;
        }
        //cout << mid << '\n';
    }
    cout << r;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 1108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 1108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 980 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 960 KB Output isn't correct
2 Halted 0 ms 0 KB -