제출 #624746

#제출 시각아이디문제언어결과실행 시간메모리
624746Icebear16모임들 (IOI18_meetings)C++14
0 / 100
302 ms400328 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define sz(a) a.size() vector<long long> minimum_costs(vector<int> H, std::vector<int> L,std::vector<int> R) { int Q = L.size(); long long adj[5000][5000]; vector<long long> C(Q); long long ans=3000000000007; for(int i=0;i<sz(H);i++){ adj[i][i]=H[i]; int l=H[i]; for(int k=i-1;k>=0;k--){ l=max(l,H[k]); adj[i][k]=l; } l=H[i]; for(int k=i+1;k<sz(H);k++){ l=max(l,H[k]); adj[i][k]=l; } } for(int i=0;i<sz(H);i++){ for(int j=1;j<sz(H);j++){ adj[i][j]+=adj[i][j-1]; } } // for(int i=0;i<sz(H);i++){ // for(int j=0;j<sz(H);j++){ // cout<<adj[i][j]<<" "; // } // cout<<endl; // } for(int i=0;i<Q;i++){ for(int j=0;j<sz(H);j++){ if(L[i]==0){ ans=min(ans,adj[i][j]); }else{ ans=min(ans,adj[i][j-1]); } } C[i]=ans; } return C; }

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

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:11:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |    for(int i=0;i<sz(H);i++){
      |                 ^
meetings.cpp:19:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for(int k=i+1;k<sz(H);k++){
      |                    ^
meetings.cpp:24:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |  for(int i=0;i<sz(H);i++){
      |               ^
meetings.cpp:25:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   for(int j=1;j<sz(H);j++){
      |                ^
meetings.cpp:36:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |   for(int j=0;j<sz(H);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...