답안 #70571

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70571 2018-08-23T06:18:44 Z Kmcode 전선 연결 (IOI17_wiring) C++14
0 / 100
3 ms 528 KB
#include <bits/stdc++.h>

using namespace std;


#include "wiring.h"

long long min_total_length(std::vector<int> r, std::vector<int> b) {
	int rr=r.size()-1;
	int bb=0;
	long long int dist=0;
	while(rr>=0||bb<b.size()){
		dist+=b[min((int)b.size()-1,bb)]-r[max(0,rr)];
		rr--;
		bb++;
	}
	return dist;
}

Compilation message

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:12:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while(rr>=0||bb<b.size()){
               ~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 376 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4369'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 476 KB 3rd lines differ - on the 1st token, expected: '904', found: '1109'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 476 KB Output is correct
2 Incorrect 3 ms 528 KB 3rd lines differ - on the 1st token, expected: '17703', found: '-19052'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 528 KB 3rd lines differ - on the 1st token, expected: '27', found: '12'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 376 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-4369'
2 Halted 0 ms 0 KB -