제출 #313026

#제출 시각아이디문제언어결과실행 시간메모리
313026reymontada61모임들 (IOI18_meetings)C++14
4 / 100
5588 ms1568 KiB
#include "meetings.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,
                                     std::vector<int> R) {
  int Q = L.size();
  std::vector<long long> C(Q);
  
  for (int i=0; i<Q; i++) {
	  int l = L[i], r = R[i];
	  long long mncost = LLONG_MAX;
	  for (int j=l; j<=r; j++) {
		  long long with = 0;
		  int mc = 0;
		  for (int T=j; T<=r; T++) {
			 mc = max(mc, H[T]);
			 with += mc; 
		  }
		  mc = 0;
		  for (int T=j; T>=l; T--) {
			  mc = max(mc, H[T]);
			  with += mc;
		  }
		  with -= H[j];
		  mncost = min(mncost, with);
	  }
	  C[i] = mncost;
  }
  
  return C;
  
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...