#include "wiring.h"
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
vi R, B;
long long min_total_length(std::vector<int> _R, std::vector<int> _B)
{
R.resize(sz(_R)), B.resize(sz(_B));
for (int i = 0; i < sz(_R); ++i)
R[i] = _R[i];
for (int i = 0; i < sz(_B); ++i)
B[i] = _B[i];
ll ans = 0;
for (int i = 0; i < sz(R); ++i)
ans += B.front() - R[i];
for (int i = 0; i < sz(B); ++i)
ans += B[i] - R.back();
ans -= (B.front() - R.back()) * min(sz(R), sz(B));
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-4909' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
13 ms |
2644 KB |
Output is correct |
4 |
Correct |
20 ms |
2644 KB |
Output is correct |
5 |
Correct |
14 ms |
4052 KB |
Output is correct |
6 |
Correct |
19 ms |
5292 KB |
Output is correct |
7 |
Correct |
18 ms |
5300 KB |
Output is correct |
8 |
Correct |
19 ms |
5444 KB |
Output is correct |
9 |
Correct |
19 ms |
5324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
3rd lines differ - on the 1st token, expected: '17703', found: '-19052' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
3rd lines differ - on the 1st token, expected: '27', found: '12' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '-4909' |
2 |
Halted |
0 ms |
0 KB |
- |