# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
779092 |
2023-07-11T07:45:33 Z |
vjudge1 |
Cipele (COCI18_cipele) |
C++17 |
|
775 ms |
4972 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);
#define OYY 1000000005
#define mod 998244353
vector <int> v,t;
int32_t main(){
faster
int n,m;cin>>n>>m;
int deg;
for(int i=0;i<n;i++){
cin>>deg;
v.push_back(deg);
}
for(int i=0;i<n;i++){
cin>>deg;
t.push_back(deg);
}
sort(v.begin(),v.end());
sort(t.begin(),t.end());
int maxi=0;
if(n<m){
for(int i=0;i<n;i++){
int c=lower_bound(t.begin(),t.end(),v[i])-t.begin();
maxi=max(maxi,abs(v[i]-t[c]));
t.erase(t.begin()+c);
}
}
else{
for(int i=0;i<m;i++){
int c=lower_bound(v.begin(),v.end(),t[i])-v.begin();
maxi=max(maxi,abs(t[i]-v[c]));
v.erase(v.begin()+c);
}
}
cout<<maxi<<'\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
775 ms |
4456 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
772 ms |
4448 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
3 ms |
468 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
596 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
592 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
588 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
980 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
320 ms |
4932 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
573 ms |
4972 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
342 ms |
4940 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |