Submission #1157137

#TimeUsernameProblemLanguageResultExecution timeMemory
1157137the_ZHERArt Collections (BOI22_art)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "art.h"
using namespace std;
void solve(int N){
    vector<int>ans;
    int pos[5000];
    for(int i=1;i<=n;i++){
        ans.push_back(i);
        pos[i]=i-1;
    }
    int was[5000];
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(was[j]==1){
                continue;
            }
            pos[ans[0]]=ans[j];
            swap(ans[pos[j]],ans[0]);
            pos[j]=0;
            int x=publish(v);
            pos[ans[0]]=n-i;
            pos[ans[n-i]]=0;
            swap(ans[0],ans[n-i]);
        }
    }
    answer(ans);
}

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:7:20: error: 'n' was not declared in this scope
    7 |     for(int i=1;i<=n;i++){
      |                    ^
art.cpp:12:20: error: 'n' was not declared in this scope
   12 |     for(int i=1;i<=n;i++){
      |                    ^
art.cpp:20:27: error: 'v' was not declared in this scope
   20 |             int x=publish(v);
      |                           ^