Submission #865242

# Submission time Handle Problem Language Result Execution time Memory
865242 2023-10-24T06:45:20 Z sleepntsheep Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include "art.h"
void solve(int N){std::vector<int>o(N),r(N,-1);int i,c=1,l=-1,d;for(;c<N;++c){d=l;if(l+1){auto it=std::find(o.begin(),o.end(),c+1);std::swap(o[1],*it);std::swap(o[0],*std::find(o.begin(),o.end(),c));d=publish(o);}o.erase(o.begin());o.push_back(c);l=publish(o);d-=l;r[(N-1+d)/2]=c++;}for(i=0;i++<N;)if(std::find(r.begin(),r.end(),i)==r.end())*std::find(r.begin(),r.end(),-1)=i;answer(r); }

Compilation message

art.cpp: In function 'void solve(int)':
art.cpp:2:104: error: 'find' is not a member of 'std'
    2 | void solve(int N){std::vector<int>o(N),r(N,-1);int i,c=1,l=-1,d;for(;c<N;++c){d=l;if(l+1){auto it=std::find(o.begin(),o.end(),c+1);std::swap(o[1],*it);std::swap(o[0],*std::find(o.begin(),o.end(),c));d=publish(o);}o.erase(o.begin());o.push_back(c);l=publish(o);d-=l;r[(N-1+d)/2]=c++;}for(i=0;i++<N;)if(std::find(r.begin(),r.end(),i)==r.end())*std::find(r.begin(),r.end(),-1)=i;answer(r); }
      |                                                                                                        ^~~~
art.cpp:2:173: error: 'find' is not a member of 'std'
    2 | void solve(int N){std::vector<int>o(N),r(N,-1);int i,c=1,l=-1,d;for(;c<N;++c){d=l;if(l+1){auto it=std::find(o.begin(),o.end(),c+1);std::swap(o[1],*it);std::swap(o[0],*std::find(o.begin(),o.end(),c));d=publish(o);}o.erase(o.begin());o.push_back(c);l=publish(o);d-=l;r[(N-1+d)/2]=c++;}for(i=0;i++<N;)if(std::find(r.begin(),r.end(),i)==r.end())*std::find(r.begin(),r.end(),-1)=i;answer(r); }
      |                                                                                                                                                                             ^~~~
art.cpp:2:307: error: 'find' is not a member of 'std'
    2 | void solve(int N){std::vector<int>o(N),r(N,-1);int i,c=1,l=-1,d;for(;c<N;++c){d=l;if(l+1){auto it=std::find(o.begin(),o.end(),c+1);std::swap(o[1],*it);std::swap(o[0],*std::find(o.begin(),o.end(),c));d=publish(o);}o.erase(o.begin());o.push_back(c);l=publish(o);d-=l;r[(N-1+d)/2]=c++;}for(i=0;i++<N;)if(std::find(r.begin(),r.end(),i)==r.end())*std::find(r.begin(),r.end(),-1)=i;answer(r); }
      |                                                                                                                                                                                                                                                                                                                   ^~~~
art.cpp:2:348: error: 'find' is not a member of 'std'
    2 | void solve(int N){std::vector<int>o(N),r(N,-1);int i,c=1,l=-1,d;for(;c<N;++c){d=l;if(l+1){auto it=std::find(o.begin(),o.end(),c+1);std::swap(o[1],*it);std::swap(o[0],*std::find(o.begin(),o.end(),c));d=publish(o);}o.erase(o.begin());o.push_back(c);l=publish(o);d-=l;r[(N-1+d)/2]=c++;}for(i=0;i++<N;)if(std::find(r.begin(),r.end(),i)==r.end())*std::find(r.begin(),r.end(),-1)=i;answer(r); }
      |                                                                                                                                                                                                                                                                                                                                                            ^~~~
interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~