제출 #1172225

#제출 시각아이디문제언어결과실행 시간메모리
1172225sasdeArt Collections (BOI22_art)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "art.h" #define task "strdel" #define ii pair<int,int> #define iii pair<int,ii> #define iv pair<ii,ii> #define se second #define fi first #define ffi fi.fi #define sfi se.fi #define sse se.se #define fse fi.se #define lt(i, c, d) for(int i = c; i <= d; ++i) #define fl(i, c, d) for(int i = d; i >= c; --i) #define pb push_back #define emb emplace_back #define emf emplace_front #define em emplace using namespace std; mt19937 rd(chrono::steady_clock::now().time_since_epoch().count()); int Rand(int u,int v){ return u+rd()%(v-u+1); } vector<int>ans,res; int n,tong; bool k[N]; void cc(int i){ if(i>n){ int u=publish(res); if(u==tong){ ans=res; } tong=u; return; } for(int j=1;j<=n;++j){ if(!k[j]){ k[j]=true; res.emb(j); cc(i+1); res.pop_back(); k[j]=false; } } } void solve(int N){ n=N; cc(1); ansewer(ans); }

컴파일 시 표준 에러 (stderr) 메시지

art.cpp:26:8: error: 'N' was not declared in this scope
   26 | bool k[N];
      |        ^
art.cpp: In function 'void cc(int)':
art.cpp:37:21: error: 'k' was not declared in this scope
   37 |                 if(!k[j]){
      |                     ^
art.cpp: In function 'void solve(int)':
art.cpp:50:9: error: 'ansewer' was not declared in this scope; did you mean 'answer'?
   50 |         ansewer(ans);
      |         ^~~~~~~
      |         answer