답안 #600585

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
600585 2022-07-21T05:35:37 Z pakhomovee 전선 연결 (IOI17_wiring) C++17
13 / 100
25 ms 3748 KB
#include "wiring.h"
#include <algorithm>
using namespace std;

long long min_total_length(std::vector<int> r, std::vector<int> b) {
    long long ans = 0;
    int red = r.size();
    int blue = b.size();
    for (int i = 0; i < red - blue; ++i) {
        ans += b[0] - r[i];
    }
    int ptr = max(0, red - blue);
    for (int i = 0; i < blue; ++i) {
        ans += b[i] - r[min(red - 1, ptr++)];
    }
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4909'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 17 ms 2916 KB Output is correct
4 Correct 20 ms 2908 KB Output is correct
5 Correct 17 ms 2900 KB Output is correct
6 Correct 25 ms 3660 KB Output is correct
7 Correct 24 ms 3660 KB Output is correct
8 Correct 25 ms 3736 KB Output is correct
9 Correct 24 ms 3748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 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 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4909'
2 Halted 0 ms 0 KB -