제출 #232356

#제출 시각아이디문제언어결과실행 시간메모리
232356jam_xd_쌀 창고 (IOI11_ricehub)C++17
컴파일 에러
0 ms0 KiB
#include "ricehub.h" int besthub(int R, int L, int X[], long long B) { int rhub = 1;//thub=0; int operaciones = 0, c_hub=0; multiset<int>dinamic_multiset; for(int i=0;i<X.size();i++){ if(rhub <= X[i]){ for(int j=X[i];j>=rhub;j++){ operaciones++; if(operaciones >= B){ dinamic_multiset.insert(c_hub); operaciones=0; c_hub=0; break; } } c_hub++; } if(rhub >= X[i]){ for(int j=X[i];j<=rhub;j++){ operaciones++; if(operaciones>=B){ dinamic_multiset.insert(c_hub); operaciones = 0; c_hub=0; break; } } c_hub++; } } multiset<int>::iterator it = dinamic_multiset.end(); for(it = dinamic_multiset.begin(); it != dinamic_multiset.end(); it++){ if(it != dinamic_multiset.end())R = (*it); } ///////////////////////////////////////////////////////////////////// /*for(int i=1;i<=L;i++){ }*/ return R; }

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

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:9:1: error: 'multiset' was not declared in this scope
 multiset<int>dinamic_multiset;
 ^~~~~~~~
ricehub.cpp:9:10: error: expected primary-expression before 'int'
 multiset<int>dinamic_multiset;
          ^~~
ricehub.cpp:11:17: error: request for member 'size' in 'X', which is of non-class type 'int*'
 for(int i=0;i<X.size();i++){
                 ^~~~
ricehub.cpp:17:5: error: 'dinamic_multiset' was not declared in this scope
     dinamic_multiset.insert(c_hub);
     ^~~~~~~~~~~~~~~~
ricehub.cpp:33:5: error: 'dinamic_multiset' was not declared in this scope
     dinamic_multiset.insert(c_hub);
     ^~~~~~~~~~~~~~~~
ricehub.cpp:43:10: error: expected primary-expression before 'int'
 multiset<int>::iterator it = dinamic_multiset.end();
          ^~~
ricehub.cpp:44:5: error: 'it' was not declared in this scope
 for(it = dinamic_multiset.begin(); it != dinamic_multiset.end(); it++){
     ^~
ricehub.cpp:44:5: note: suggested alternative: 'int'
 for(it = dinamic_multiset.begin(); it != dinamic_multiset.end(); it++){
     ^~
     int
ricehub.cpp:44:10: error: 'dinamic_multiset' was not declared in this scope
 for(it = dinamic_multiset.begin(); it != dinamic_multiset.end(); it++){
          ^~~~~~~~~~~~~~~~