# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
922305 |
2024-02-05T11:50:11 Z |
12345678 |
Cipele (COCI18_cipele) |
C++17 |
|
35 ms |
3028 KB |
#include <bits/stdc++.h>
using namespace std;
int n, m;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>m;
vector<int> a(n), b(m);
for (auto &x:a) cin>>x;
for (auto &x:b) cin>>x;
sort(a.begin(), a.end());
sort(b.begin(), b.end());
if (n>m) swap(n, m), swap(a, b);
int l=0, r=1e9;
while (l<r)
{
int md=(l+r)/2, can=1, idx=0;
for (int i=0; i<n; i++)
{
while (idx<m&&abs(b[idx]-a[i])>md) idx++;
if (idx>=m) can=0;
else idx++;
}
if (can) r=md;
else l=md+1;
}
cout<<l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
1252 KB |
Output is correct |
2 |
Correct |
35 ms |
1116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
1368 KB |
Output is correct |
2 |
Correct |
33 ms |
3028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
592 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
856 KB |
Output is correct |
2 |
Correct |
19 ms |
1880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
1112 KB |
Output is correct |
2 |
Correct |
14 ms |
2140 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
860 KB |
Output is correct |
2 |
Correct |
28 ms |
2648 KB |
Output is correct |