# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
95001 |
2019-01-26T15:27:00 Z |
karlopuh |
Cipele (COCI18_cipele) |
C++14 |
|
103 ms |
3220 KB |
#include <bits/stdc++.h>
using namespace std;
vector<int> ljev;
vector<int> desn;
int uzmi;
int maks=-1;
int l,r;
int main(){
cin>>l>>r;
for(int i=0;i<l;i++){
int br;
cin>>br;
ljev.push_back(br);
}
for(int i=0;i<r;i++){
int br;
cin>>br;
desn.push_back(br);
}
sort(ljev.begin(),ljev.end());
sort(desn.begin(),desn.end());
if(l>r){
uzmi=ljev[0];
ljev.erase(ljev.begin());
for(int i=0;i<r;i++){
if(abs(ljev[i]-desn[i])>maks)maks=abs(ljev[i]-desn[i]);
if(abs(uzmi-desn[i])<maks)maks=abs(uzmi-desn[i]);
}
}
else if(r>l){
uzmi=desn[0];
desn.erase(desn.begin());
for(int i=0;i<l;i++){
if(abs(ljev[i]-desn[i])>maks)maks=abs(ljev[i]-desn[i]);
if(abs(uzmi-ljev[i])<maks)maks=abs(ljev[i]-uzmi);
}
}else{
for(int i=0;i<l;i++){
if(abs(ljev[i]-desn[i])>maks)maks=abs(ljev[i]-desn[i]);
}
}
cout<<maks;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
76 ms |
3056 KB |
Output is correct |
2 |
Correct |
97 ms |
3220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
103 ms |
3180 KB |
Output is correct |
2 |
Correct |
98 ms |
3124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
492 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
79 ms |
2792 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
87 ms |
2928 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
76 ms |
2812 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |