제출 #413181

#제출 시각아이디문제언어결과실행 시간메모리
413181Ahmadsm2005모임들 (IOI18_meetings)C++14
0 / 100
455 ms381732 KiB
#include "meetings.h" //#include "grader.cpp" #pragma GCC optimize("trapv") #include<bits/stdc++.h> using namespace std; vector<long long>LL,RR; vector<int>h; long long ACC[5001][5001],DP[5001][5001]; long long query(int L,int R){ long long miner=(int)2e18; for(int i=L;i<=R;i++){ //cout<<R<<' '<<i<<' '<<DP[R][i]<<endl; miner=min(miner,DP[L][i]+DP[R][i]-DP[i][i]); } return miner; } vector<long long>minimum_costs(vector<int>H,vector<int>L,vector<int>R){ h=H; vector<long long>ANS; for(int i=0;i<H.size();i++){ int maxer=0; for(int l=i;l<H.size();l++) maxer=max(maxer,H[l]),ACC[i][l]=maxer; } for(int i=0;i<H.size();i++){ long long CUR=0; for(int l=0;l<=i;l++) CUR+=ACC[l][i]; for(int l=0;l<H.size();l++) DP[l][i]=CUR,CUR-=ACC[l][i]; CUR=0; for(int l=i;l<H.size();l++) CUR+=ACC[i][l],DP[l][i]=CUR; } for(int i=0;i<L.size();i++) ANS.push_back(query(L[i],R[i])); 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:20:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 | for(int i=0;i<H.size();i++){
      |             ~^~~~~~~~~
meetings.cpp:22:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 | for(int l=i;l<H.size();l++)
      |             ~^~~~~~~~~
meetings.cpp:25:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 | for(int i=0;i<H.size();i++){
      |             ~^~~~~~~~~
meetings.cpp:29:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 | for(int l=0;l<H.size();l++)
      |             ~^~~~~~~~~
meetings.cpp:32:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 | for(int l=i;l<H.size();l++)
      |             ~^~~~~~~~~
meetings.cpp:35:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 | 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...