제출 #1155048

#제출 시각아이디문제언어결과실행 시간메모리
1155048sitablechairIsland Hopping (JOI24_island)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

#define ll long long
#define ldb long double
#define For(i,l,r) for(int i=l;i<=r;i++)
#define ForD(i,r,l) for(int i=r;i>=l;i--)
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (signed)x.size()
#define unq(x) x.resize(unique(all(x))-x.begin())
#define F "TASK"
#define fio freopen(F".INP","r",stdin);freopen(F".OUT","w",stdout);

#ifdef NCGM
#include"debug.h"
#else 
#define debug(...) "fr";
#endif

using namespace std;

int m,kk[304][304];
vector<int> g1[305];
vector<pair<int,int>> ans;


void solve(int n,int l) {
    For(i,1,n)
        For(j,1,n-1) kk[i][j]=-1;
    For(i,1,n) kk[i][1]=query(i,1);
    ForD(i,n,1) {
        int cur=1;
        while(true) {
            if (sz(g1[i])==n-1) break;
            if (cur>1) kk[i][cur]=query(i,cur);
            int u=kk[i][cur];
            cur++;
            if (u<i) {
                bool check=1;
                for(auto el: g1[i]) 
                    check&=kk[el][1]!=u;
                if (!check) break;
                g1[i].pb(u);
            } else break;
        }
    }
    For(i,1,n)
        for(auto el: g1[i])
            if (el>i) ans.pb({el,i});
            else ans.pb({i,el});
    sort(all(ans));
    unq(ans);
    for(auto el: ans) answer(el.ff,el.ss);
}   

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

island.cpp: In function 'void solve(int, int)':
island.cpp:32:25: error: 'query' was not declared in this scope
   32 |     For(i,1,n) kk[i][1]=query(i,1);
      |                         ^~~~~
island.cpp:37:35: error: 'query' was not declared in this scope
   37 |             if (cur>1) kk[i][cur]=query(i,cur);
      |                                   ^~~~~
island.cpp:55:23: error: 'answer' was not declared in this scope
   55 |     for(auto el: ans) answer(el.ff,el.ss);
      |                       ^~~~~~