제출 #1289885

#제출 시각아이디문제언어결과실행 시간메모리
1289885enzyICC (CEOI16_icc)C++20
컴파일 에러
0 ms0 KiB
#include"icc.h" #include <bits/stdc++.h> using namespace std; const int maxn=110; const int maxk=7; vector<int>v[maxn]; int pai[maxn]; int faz_query(int x, int y, vector<int>a, vector<int>b){ int A[x], B[y]; for(int i=0;i<x;i++) A[i]=a[i]; for(int i=0;i<y;i++) B[i]=b[i]; return query(x,y,A,B); } int find(vector<int> a, vector<int> b){ int id=0; for(int k=0;k<maxk;k++){ vector<int>aux; for(int j=0;j<a.size();j++) if(j&(1<<k)) aux.push_back(a[j]); if(aux.size()&&faz_query(aux.size(),b.size(),aux,b)) id+=(1<<k); } return a[id]; } void run(int n){ for(int i=1;i<=n;i++) v[i].clear(); for(int i=1;i<=n;i++) v[i].push_back(i); for(int i=1;i<n;i++){ vector<int>a, b, aux; int at=__lg(n-i+1); for(int i=0;i<=at;i++) aux.push_back(i); shuffle(aux.begin(),aux.end(),rng); for(int z=0;z<=at;z++){ k=aux[z]; a.clear(); b.clear(); for(int j=1;j<=n-i+1;j++){ if(j&(1<<k)) for(int x : v[j]) a.push_back(x); else for(int x : v[j]) b.push_back(x); } if(z==at) break; if(a.size()&&b.size()&&faz_query(a.size(),b.size(),a,b)) break; } int u=find(a,b), w=find(b,a), repu=0, repw=0; setRoad(u,w); for(int j=1;j<=n-i+1;j++){ for(int x : v[j]){ if(x==u&&repu) assert(false); if(x==w&&repw) assert(false); if(x==u) repu=j; if(x==w) repw=j; } } assert(repu&&repw); if(repu>repw) swap(repu,repw); for(int x : v[repw]) v[repu].push_back(x); v[repw].clear(); for(int x : v[n-i+1]) v[repw].push_back(x); v[n-i+1].clear(); } }

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

icc.cpp: In function 'void run(int)':
icc.cpp:30:39: error: 'rng' was not declared in this scope
   30 |         shuffle(aux.begin(),aux.end(),rng);
      |                                       ^~~
icc.cpp:32:13: error: 'k' was not declared in this scope
   32 |             k=aux[z];
      |             ^