#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();
int minn=min(n,m);
long long ans=0;
for(int i=0;i<minn;i++)
ans+=b[m-i-1]-r[i];
for(int i=minn;i<n;i++)
ans+=b[0]-r[i];
for(int i=minn;i<m;i++)
ans+=b[m-i-1]-r[n-1];
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-4909' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
28 ms |
1528 KB |
Output is correct |
4 |
Correct |
25 ms |
1660 KB |
Output is correct |
5 |
Correct |
25 ms |
1656 KB |
Output is correct |
6 |
Correct |
36 ms |
2040 KB |
Output is correct |
7 |
Correct |
40 ms |
2112 KB |
Output is correct |
8 |
Correct |
38 ms |
2040 KB |
Output is correct |
9 |
Correct |
35 ms |
2040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
384 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 |
2 ms |
256 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 |
2 ms |
384 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-4909' |
2 |
Halted |
0 ms |
0 KB |
- |