#include <bits/stdc++.h>
#define fi first
#define se second
#define NAME "wiring"
using namespace std;
typedef long long LL;
typedef pair <int, int> pii;
typedef double DB;
typedef pair <LL, LL> pLL;
const int NMAX = 1e6+7;
int n, m;
LL min_total_length(vector <int> r, vector <int> b) {
LL res = 0;
n = r.size();
m = b.size();
sort(r.begin(), r.end());
sort(b.begin(), b.end());
if(r[n-1] < b[0]) {
for(int i = 0; i < n; ++i)
res += abs(b[0] - r[i]);
for(int i = 1; i < m; ++i)
res += abs(b[i] - r[n-1]);
return res;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
380 KB |
3rd lines differ - on the 1st token, expected: '904', found: '946' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
380 KB |
3rd lines differ - on the 1st token, expected: '316', found: '356' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
424 KB |
3rd lines differ - on the 1st token, expected: '27', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |