Submission #871803

#TimeUsernameProblemLanguageResultExecution timeMemory
871803imarnArt Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> //#include "art.h" #define f first #define s second #define ll long long #define pb push_back #define pii pair<int,int> #define pll pair<ll,ll> #define sz(x) (int)x.size() #define all(x) x.begin(),x.end() using namespace std; void solve(int N) { vector<int>a(N); int ans[N+1]; for(int i=0;i<N;i++)a[i]=i+1; int tt1=publish(a);int st=tt1; for(int i=1;i<=N-1;i++){ for(int j=i;j<N;j++)a[j]=j-i+1; for(int j=0;j<i;j++)a[j]=N-i+j+1; int tt2=publish(a); ans[N-i+1]=(N-1+tt2-tt1)/2; tt1=tt2; }ans[1]=(N-1+st-tt1)/2; vector<int>ord(N); for(int i=1;i<=N;i++)ord[ans[i]-1]=i; answer(ord); }

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:16:13: error: 'publish' was not declared in this scope
   16 |     int tt1=publish(a);int st=tt1;
      |             ^~~~~~~
art.cpp:26:5: error: 'answer' was not declared in this scope
   26 |     answer(ord);
      |     ^~~~~~
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) {
      |        ~~~~~~~~~^~~~