# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
240519 | 2020-06-19T20:05:18 Z | DavidDamian | Cipele (COCI18_cipele) | C++11 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; int n,m; vector<int> A; vector<int> B; int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n>>m; for(int i=1;i<=n;i++){ int x; cin>>x; A.push_back(x); } for(int i=1;i<=m;i++){ int x; cin>>x; B.push_back(x); } sort(A.begin(),A.end()); sort(B.begin(),b.end()); int maximum=0; for(int i=0;i<n;i++){ maximum=max(maximum,abs(A[i]-B[i])); } cout<<maximum<<'\n'; return 0; }