# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
472320 | 2021-09-13T11:40:23 Z | MamdouhN | Cipele (COCI18_cipele) | C++14 | 100 ms | 2576 KB |
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" vector<int>L,R; main() { int n,m; cin>>n>>m; for(int i=0;i<n;i++) { int x; cin>>x; L.push_back(x); } for(int i=0;i<m;i++) { int x; cin>>x; R.push_back(x); } sort(L.begin(),L.end()); sort(R.begin(),R.end()); if(n>m) { swap(n,m); swap(L,R); } int st=0,en=m-1; while(en-st+1>L.size()) { int s = abs(R[st] - L[0]); int e = abs(R[en] - L[n-1]); if(s<=e)en--; else st++; } int ans=0; for(int i=0;i<n;i++) { int x = abs(L[i]-R[st]); ans=max(ans,x); st++; } cout<<ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 79 ms | 2552 KB | Output is correct |
2 | Correct | 100 ms | 2576 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 97 ms | 2540 KB | Output is correct |
2 | Correct | 96 ms | 2484 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 332 KB | Output is correct |
2 | Correct | 6 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 380 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 80 ms | 2248 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 95 ms | 2488 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 80 ms | 2396 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |