제출 #1360993

#제출 시각아이디문제언어결과실행 시간메모리
1360993Jawad_Akbar_JJ도로 폐쇄 (APIO21_roads)C++17
5 / 100
21 ms4656 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

vector<long long> sub1(int n, vector<int> U, vector<int> V, vector<int> W){
	sort(rbegin(W), rend(W));

	vector<long long> Ans(n, 0);
	for (int i : W)
		Ans[0] += i;
	for (int i=1;i<=W.size();i++)
		Ans[i] = Ans[i-1] - W[i-1];
	return Ans;
}

vector<long long> minimum_closure_costs(int n, vector<int> U, vector<int> V, vector<int> W){
	bool t = 1;
	for (int i=0;i<n-1;i++)
		t &= U[i] == 0;

	if (t)
		return sub1(n, U, V, W);
	// return sub2(n, U, V, W);
}

컴파일 시 표준 에러 (stderr) 메시지

roads.cpp: In function 'std::vector<long long int> minimum_closure_costs(int, std::vector<int>, std::vector<int>, std::vector<int>)':
roads.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…