Submission #232367

#TimeUsernameProblemLanguageResultExecution timeMemory
232367jam_xd_Rice Hub (IOI11_ricehub)C++17
Compilation error
0 ms0 KiB
#include "ricehub.h" #include <bits/stdc++.h> int besthub(int R, int L, int X[], long long B) { int rhub = 1,RP;//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(); bool meh; for(it = dinamic_multiset.begin(),meh!=true;it++) if(it == dinamic_multiset.end()){ RP = (*it); break; } } ///////////////////////////////////////////////////////////////////// /*for(int i=1;i<=L;i++){ }*/ return RP; }

Compilation message (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:1: note: suggested alternative:
In file included from /usr/include/c++/7/set:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:87,
                 from ricehub.cpp:2:
/usr/include/c++/7/bits/stl_set.h:69:11: note:   'std::multiset'
     class 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:47:5: error: 'it' was not declared in this scope
 for(it = dinamic_multiset.begin(),meh!=true;it++)
     ^~
ricehub.cpp:47:5: note: suggested alternative: 'int'
 for(it = dinamic_multiset.begin(),meh!=true;it++)
     ^~
     int
ricehub.cpp:47:10: error: 'dinamic_multiset' was not declared in this scope
 for(it = dinamic_multiset.begin(),meh!=true;it++)
          ^~~~~~~~~~~~~~~~
ricehub.cpp:47:49: error: expected ';' before ')' token
 for(it = dinamic_multiset.begin(),meh!=true;it++)
                                                 ^
ricehub.cpp:52:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
ricehub.cpp: At global scope:
ricehub.cpp:63:3: error: expected unqualified-id before 'return'
   return RP;
   ^~~~~~
ricehub.cpp:64:1: error: expected declaration before '}' token
 }
 ^