Submission #83371

#TimeUsernameProblemLanguageResultExecution timeMemory
83371charlies_mooCipele (COCI18_cipele)C++98
0 / 90
1083 ms4180 KiB
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<map> #include<set> #include<vector> #include<algorithm> #include<stack> #include<queue> #include<cctype> #include<sstream> using namespace std; typedef long long l; l n,m; l leftt[99999]; l rightt[99999]; l ans=-1; int main(void) { cin >> n >> m; for(int i=0;i<n;i++) cin >> leftt[i]; for(int i=0;i<m;i++) cin >> rightt[i]; sort(leftt,leftt+n); sort(rightt,rightt+m); for(l i=0;i<n;i++) { l temp=99999; for(l j=0;j<m;j++) { if((abs(leftt[i]-rightt[j]))<temp) temp=abs(leftt[i]-rightt[j]); } ans=temp; } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...