Submission #1171039

#TimeUsernameProblemLanguageResultExecution timeMemory
1171039sasdeArt Collections (BOI22_art)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "art.h"
using namespace std;
#define emb emplace_back
int n,v=0;
bool k[N];
vector<int>res;
void cc(int i){
  if(i>n){
    int u=publish(res);
    if(u==v){
answer(res);exit(0);
    }
    v=u;
    return;
  }
  for(int j=1;j<=n;++j){
    if(!k[j]){
      res.emb(j);k[j]=true;
      cc(i+1);k[j]=false;
      res.pop_back();
    }
  }
}
void solve(int N){
  n=N;
  cc(1);  
}


Compilation message (stderr)

art.cpp:6:8: error: 'N' was not declared in this scope
    6 | bool k[N];
      |        ^
art.cpp: In function 'void cc(int)':
art.cpp:18:9: error: 'k' was not declared in this scope
   18 |     if(!k[j]){
      |         ^