제출 #1171039

#제출 시각아이디문제언어결과실행 시간메모리
1171039sasdeArt Collections (BOI22_art)C++20
컴파일 에러
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); }

컴파일 시 표준 에러 (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]){
      |         ^