Submission #472215

# Submission time Handle Problem Language Result Execution time Memory
472215 2021-09-13T09:32:49 Z AbdoMo Cipele (COCI18_cipele) C++17
0 / 90
1000 ms 1952 KB
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define pb push_back
const int mod = 1e9+7;
using namespace std;
bool comp(pair<int,int>&a ,pair<int,int>&b)
{
    if(a.first==b.first)
    {
        return a.second>b.second;
    }
    return a.first<b.first;

}
void solve()
{
    int n,m;
    cin>>n>>m;
    int arr[100000],arr2[100000];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    for(int i=0;i<m;i++)
    {
        cin>>arr2[i];
    }
    int ans=0;
        bool vis[100000]={};
        for(int i=0;i<n;i++)
        {
            int t=1e13;
            int ind=0;
            for(int j=0;j<m;j++)
            {
                if(vis[j])continue;
                if(abs(arr[i]-arr2[j])<t)
                {
                    t=abs(arr[i]-arr2[j]);
                    ind = j;
                }

            }
            vis[ind]=1;
            ans=max(ans,t);
        }
    cout<<ans<<endl;


}
int32_t main(){
	int t=1;
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //cin>>t;
	while(t--){solve();}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1089 ms 1868 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1089 ms 1868 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1868 KB Output is correct
2 Incorrect 73 ms 1868 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1868 KB Output is correct
2 Incorrect 72 ms 1868 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 1868 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 54 ms 1868 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 68 ms 1952 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1079 ms 1868 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 1868 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1086 ms 1868 KB Time limit exceeded
2 Halted 0 ms 0 KB -