답안 #919337

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
919337 2024-01-31T15:32:22 Z winter0101 카멜레온의 사랑 (JOI20_chameleon) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
#define all(fl) fl.begin(),fl.end()
#define pb push_back
#define fi first
#define se second
#define for1(i,j,k) for(int i=j;i<=k;i++)
#define for2(i,j,k) for(int i=j;i>=k;i--)
#define for3(i,j,k,l) for(int i=j;i<=k;i+=l)
#define lb lower_bound
#define ub upper_bound
#define sz(a) (int)a.size()
#define pii pair<int,int>
#define pli pair<long long,int>
#define gcd __gcd
#define lcm(x,y) x*y/__gcd(x,y)
const int maxn=1e3+9;
vector<int>a[maxn];
bool edg[maxn][maxn];
void Solve(int n){
    for1(i,1,2*n){
    for1(j,1,2*n){
    if (i==j)continue;
    if (Query({i,j})==1){
    a[i].pb(j);
    }
    }
    }
    vector<pii>ans;
    for1(i,1,2*n){
    if (sz(a[i])==1){
    for (auto v:a[i]){
    edg[v][i]=edg[i][v]=1;
    }
    }
    else {
    vector<int>check;
    check.pb(i);
    for1(j,0,sz(a[i])-1){
    check.pb(a[i][j]);
    for1(k,j+1,sz(a[i])-1){
    check.pb(a[i][k]);
    if (Query(check)==1){
    edg[i][a[i][j]]=1;
    edg[i][a[i][k]]=1;
    }
    check.pop_back();
    }
    check.pop_back();
    }
    }
    }
    for1(i,1,2*n){
    for1(j,i+1,2*n){
    if (edg[i][j]&&edg[j][i]){
    Answer(i,j);
    }
    }
    }
}

Compilation message

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:24:9: error: 'Query' was not declared in this scope
   24 |     if (Query({i,j})==1){
      |         ^~~~~
chameleon.cpp:43:9: error: 'Query' was not declared in this scope
   43 |     if (Query(check)==1){
      |         ^~~~~
chameleon.cpp:56:5: error: 'Answer' was not declared in this scope
   56 |     Answer(i,j);
      |     ^~~~~~