#include "wiring.h"
#include <bits/stdc++.h>
using namespace std;
long long min_total_length(vector<int> r, vector<int> b){
int n=r.size(),m=b.size();
long long ans=0;
if(n>m){
int minn=2147483647;
for(int i=0;i<n;i++)
for(int j=0;j<m;j++){
minn=min(abs(b[j]-r[i]),minn);
}
ans=ans+minn;
}
else{
int minn=2147483647;
for(int i=0;i<m;i++)
for(int j=0;j<n;j++){
minn=min(abs(b[i]-r[j]),minn);
}
ans=ans+minn;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '1868' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
3rd lines differ - on the 1st token, expected: '904', found: '3' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
3rd lines differ - on the 1st token, expected: '316', found: '8' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
256 KB |
3rd lines differ - on the 1st token, expected: '27', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '1868' |
2 |
Halted |
0 ms |
0 KB |
- |