Submission #779304

# Submission time Handle Problem Language Result Execution time Memory
779304 2023-07-11T10:10:39 Z vjudge1 Cipele (COCI18_cipele) C++17
0 / 90
1000 ms 3256 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);
#define OYY 1000000005
#define mod 998244353
vector <int> v,t;
int n,m,mid,cev=OYY,tut;

inline bool yes(int x){
    tut=0;
    for(int i=0;i<m;i++){
        if(tut>=n){
            break;
        }
        if(abs(t[i]-v[tut])>x)continue;
        tut++;
    }
    if(tut>=n)return true;
    else return false;
}

int32_t main(){
    faster
    cin>>n>>m;
    int deg;
    for(int i=0;i<n;i++){
        cin>>deg;
        v.push_back(deg);
    }
    for(int i=0;i<m;i++){
        cin>>deg;
        t.push_back(deg);
    }
    if(m<n){
        swap(n,m);
        swap(v,t);
    }
    int l=0,r=1000000009;
    while(l<=r){
        mid=(l+r)/2;
        if(yes(mid)){
            r=mid-1;
            cev=mid;
        }
        else l=mid;
    }
    cout<<cev<<'\n';
    return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1052 ms 3148 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1043 ms 3256 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Execution timed out 1082 ms 460 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1069 ms 372 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1063 ms 396 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1070 ms 468 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1082 ms 468 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1058 ms 2916 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1060 ms 3060 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1036 ms 2928 KB Time limit exceeded
2 Halted 0 ms 0 KB -