#include "wiring.h"
#include <bits/stdc++.h>
using namespace std;
long long min_total_length(vector<int> r, vector<int> b) {
int ans = 0, temp;
if (b.size() > r.size()) {
for (int i=0;i<(int)b.size();i++) {
temp = min(i, (int)r.size() - 1);
ans += b[i] - r[temp];
}
} else {
for (int i=0;i<(int)r.size();i++) {
temp = min(i, (int)b.size() - 1);
ans += r[i] - b[temp];
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '4369' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
604 KB |
3rd lines differ - on the 1st token, expected: '904', found: '-1109' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
3rd lines differ - on the 1st token, expected: '316', found: '-316' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
3rd lines differ - on the 1st token, expected: '27', found: '-12' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
3rd lines differ - on the 1st token, expected: '25859', found: '4369' |
2 |
Halted |
0 ms |
0 KB |
- |