Submission #1236081

#TimeUsernameProblemLanguageResultExecution timeMemory
1236081lioowArt Collections (BOI22_art)C++20
Compilation error
0 ms0 KiB
#include "art.h" #include <bits/stdc++.h> #define push_back pb using namespace std; void solve(int N) { vector<int>order; int q[N+5]; for(int i=1;i<=N;i++){ int n=N; order.clear(); while(n--){ order.pb(i); i++; if(i>n) i=1; } q[i]=publish(order); } vector<int>ans(N); for(int i=1;i<=N;i++){ int sel; if(i==1) sel=q[1]-q[n]; else sel=q[i]-q[i-1]; ans[(N+1+sel)/2]=i-1; } answer(ans); }

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:13:23: error: 'class std::vector<int>' has no member named 'pb'
   13 |                 order.pb(i);
      |                       ^~
art.cpp:22:37: error: 'n' was not declared in this scope
   22 |                 if(i==1) sel=q[1]-q[n];
      |                                     ^