# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
710583 |
2023-03-15T11:46:48 Z |
ToroTN |
Cipele (COCI18_cipele) |
C++14 |
|
100 ms |
3556 KB |
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
int n,m,a,st,md,ed,it,type;
vector<int> v1,v2;
int main()
{
cin >> n >> m;
for(int i=1;i<=n;i++)
{
cin >> a;
v1.pb(a);
}
sort(v1.begin(),v1.end());
for(int i=1;i<=m;i++)
{
cin >> a;
v2.pb(a);
}
sort(v2.begin(),v2.end());
if(n>m)
{
swap(n,m),swap(v1,v2);
}
/*for(int i=0;i<n;i++)
{
printf("%d ",v1[i]);
}
printf("\n");
for(int i=0;i<m;i++)
{
printf("%d ",v2[i]);
}
printf("\n");*/
st=0;ed=1e9;
while(ed>=st)
{
md=(st+ed)/2;
it=0;
type=0;
//printf("%d %d %d\n",st,md,ed);
for(int i=0;i<n;i++)
{
while(1)
{
if(abs(v1[i]-v2[it])>md)
{
++it;
if(it==m)
{
type=-1;
break;
}
}else
{
++it;
break;
}
}
if(type==-1)break;
//printf("%d %d\n",i,it);
}
if(type==0)
{
ed=md-1;
}else
{
st=md+1;
}
}
printf("%d\n",st);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
3092 KB |
Output is correct |
2 |
Correct |
97 ms |
3228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
100 ms |
3008 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
436 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
364 KB |
Output is correct |
2 |
Correct |
6 ms |
476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
564 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
308 KB |
Output is correct |
2 |
Correct |
6 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
408 KB |
Output is correct |
2 |
Correct |
5 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
81 ms |
2596 KB |
Output is correct |
2 |
Correct |
60 ms |
1820 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
92 ms |
2824 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
83 ms |
2720 KB |
Output is correct |
2 |
Runtime error |
76 ms |
3556 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |