#include "wiring.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
long long min_total_length(std::vector<int> r, std::vector<int> b)
{
int n = r.size(), m = b.size();
ll rmx = r[n - 1];
ll ans = 0;
for (int i = 0; i < m; i++)
ans += b[i] - rmx;
for (int i = 0; i < n - 1; i++)
ans += rmx - r[i];
ans += max((ll)(n - m) * (b[0] - rmx), 0LL);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '445' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
14 ms |
1364 KB |
Output is correct |
4 |
Correct |
15 ms |
1412 KB |
Output is correct |
5 |
Correct |
16 ms |
1396 KB |
Output is correct |
6 |
Correct |
21 ms |
1864 KB |
Output is correct |
7 |
Correct |
20 ms |
1876 KB |
Output is correct |
8 |
Correct |
23 ms |
1876 KB |
Output is correct |
9 |
Correct |
18 ms |
1748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
276 KB |
3rd lines differ - on the 1st token, expected: '17703', found: '-19052' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
3rd lines differ - on the 1st token, expected: '27', found: '12' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '445' |
2 |
Halted |
0 ms |
0 KB |
- |