Submission #299407

#TimeUsernameProblemLanguageResultExecution timeMemory
299407Pichon5Scales (IOI15_scales)C++17
Compilation error
0 ms0 KiB
#include "scales.h" #include <bits/stdc++.h> #define vi vector<int> #define pb push_back void init(int T) { /* ... */ } void orderCoins() { /* ... */ vector<int>res; vector<bool>vis; vis.assign(7,false); //----- int a= getLightest(1,2,3); int b= getLightest(4,5,6); int c=1; if(a==c){ c=2; } a=getLightest(a,b,c); res.pb(a); vis[a]=true; //------ vector<int>v; v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getLightest(v[0],v[1],v[2]); b=getLightest(a,v[3],v[4]); res.pb(b); vis[b]=true; //--------- v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getLightest(v[0],v[1],v[2]); b=v[0]; if(a==b){ b=v[1]; } c=getLightest(a,b,v[3]); vis[c]=true; res.pb(c); //------------ v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getLightest(v[0],v[1],v[2]); vis[a]=true; //------------ v.clear(); for(int i=1;i<=6;i++){ if(vis[i]==false){ v.push_back(i); } } a=getMedian(res[0],v[0],v[1]); res.pb(a); vis[a]=false; for(int i=1;i<=6;i++){ if(vis[i]==false){ res.pb(i); break; } } answer(res); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 'T' [-Wunused-parameter]
    5 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:11:5: error: 'vector' was not declared in this scope
   11 |     vector<int>res;
      |     ^~~~~~
scales.cpp:11:5: note: suggested alternatives:
In file included from /usr/include/c++/9/vector:67,
                 from /usr/include/c++/9/functional:62,
                 from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/9/algorithm:71,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/9/bits/stl_vector.h:386:11: note:   'std::vector'
  386 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/9/functional:62,
                 from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/9/algorithm:71,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/9/vector:90:13: note:   'std::pmr::vector'
   90 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
scales.cpp:11:12: error: expected primary-expression before 'int'
   11 |     vector<int>res;
      |            ^~~
scales.cpp:12:12: error: expected primary-expression before 'bool'
   12 |     vector<bool>vis;
      |            ^~~~
scales.cpp:13:5: error: 'vis' was not declared in this scope; did you mean 'vi'?
   13 |     vis.assign(7,false);
      |     ^~~
      |     vi
scales.cpp:22:5: error: 'res' was not declared in this scope
   22 |     res.pb(a);
      |     ^~~
scales.cpp:25:12: error: expected primary-expression before 'int'
   25 |     vector<int>v;
      |            ^~~
scales.cpp:26:5: error: 'v' was not declared in this scope
   26 |     v.clear();
      |     ^