답안 #70568

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70568 2018-08-23T06:17:54 Z Kmcode 전선 연결 (IOI17_wiring) C++14
0 / 100
3 ms 536 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(),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 2 ms 248 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-9259'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 488 KB 3rd lines differ - on the 1st token, expected: '904', found: '624'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 488 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 536 KB 3rd lines differ - on the 1st token, expected: '27', found: '12'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB 3rd lines differ - on the 1st token, expected: '25859', found: '-9259'
2 Halted 0 ms 0 KB -