제출 #139358

#제출 시각아이디문제언어결과실행 시간메모리
139358wilwxk모임들 (IOI18_meetings)C++14
0 / 100
5600 ms1620 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN=1e5+5; vector<int> h, l, r; vector<ll> respf; ll anda(int ini, int fim) { if(ini>fim) swap(ini, fim); ll val=-1; for(int i=ini; i<=fim; i++) val=max(val, (ll)h[i]); return val; } ll query(int ini, int fim) { ll resp=1e18; for(int i=ini; i<=fim; i++) { ll val=0; for(int j=ini; j<=fim; j++) val+=anda(j, i); resp=min(resp, val); } return resp; } std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) { h=H; l=L; r=R; for(int i=0; i<L.size(); i++) { int ini=L[i]; int fim=R[i]; ll val=query(ini, fim); respf.push_back(val); } // int Q = L.size(); // std::vector<long long> C(Q); // for (int j = 0; j < Q; ++j) { // C[j] = H[L[j]]; // } return respf; }

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

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:30:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<L.size(); i++) {
               ~^~~~~~~~~
#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...