제출 #1067863

#제출 시각아이디문제언어결과실행 시간메모리
1067863Muhammad_Aneeq모임들 (IOI18_meetings)C++17
19 / 100
5569 ms6572 KiB
#include <vector> using namespace std; vector<long long> minimum_costs(vector<int> H, vector<int> L,vector<int> R) { int n=H.size(); vector<long long>ans(L.size(),1e15); int val[n]={}; long long pre[n+1]={}; for (int i=0;i<n;i++) { int mx=H[i]; val[i]=mx; for (int j=i-1;j>=0;j--) { mx=max(mx,H[j]); val[j]=mx; } mx=H[i]; for (int j=i+1;j<n;j++) { mx=max(mx,H[j]); val[j]=mx; } for (int j=1;j<=n;j++) pre[j]=pre[j-1]+val[j-1]; for (int j=0;j<L.size();j++) { if (i>=L[j]&&i<=R[j]) ans[j]=min(ans[j],pre[R[j]+1]-pre[L[j]]); } } return ans; }

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

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:26:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |         for (int j=0;j<L.size();j++)
      |                      ~^~~~~~~~~
#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...