#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
ll min_total_length(vector<int>r,vector<int>b){
ll ans=0,n=r.size(),m=b.size();
for(ll i=0;i<n-1;i++){
ans+=(r[i+1]-r[i])*(i+1);
}
ll cur=0;
for(ll i=m-1;i>=1;i--){
ans+=(b[i]-b[i-1])*(++cur);
}
ans+=(b[0]-r[n-1])*max(n,m);
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-4909' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
13 ms |
2908 KB |
Output is correct |
4 |
Correct |
12 ms |
2908 KB |
Output is correct |
5 |
Correct |
13 ms |
2908 KB |
Output is correct |
6 |
Correct |
17 ms |
3932 KB |
Output is correct |
7 |
Correct |
16 ms |
3932 KB |
Output is correct |
8 |
Correct |
17 ms |
3768 KB |
Output is correct |
9 |
Correct |
17 ms |
3932 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
3rd lines differ - on the 1st token, expected: '17703', found: '-19052' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
3rd lines differ - on the 1st token, expected: '27', found: '12' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-4909' |
2 |
Halted |
0 ms |
0 KB |
- |