답안 #923527

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
923527 2024-02-07T11:34:48 Z alexander707070 카멜레온의 사랑 (JOI20_chameleon) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "chameleon.h"
#define MAXN 1007

namespace {

int n;


}  // namespace

vector<int> to[MAXN];

void Solve(int N) {
    n=N;
    for(int i=1;i<=2*n;i++){
        for(int f=i+1;f<=2*n;f++){
            if(Query({i,f})==1){
                to[i].push_back(f);
                to[f].push_back(i);
            }
        }
    }

    for(int i=1;i<=2*n;i++){
        if(to[i].size()==1){
            if(i<to[i][0])Answer(i,to[i][0]);
        }else{
            for(int f:to[to[i][0]]){
                if(f==i and i<to[i][0])Answer(i,to[i][0]);
            }
            for(int f:to[to[i][1]]){
                if(f==i and i<to[i][1])Answer(i,to[i][1]);
            }
        }
    }
}

Compilation message

chameleon.cpp:12:1: error: 'vector' does not name a type
   12 | vector<int> to[MAXN];
      | ^~~~~~
chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:19:17: error: 'to' was not declared in this scope; did you mean 'tm'?
   19 |                 to[i].push_back(f);
      |                 ^~
      |                 tm
chameleon.cpp:26:12: error: 'to' was not declared in this scope; did you mean 'tm'?
   26 |         if(to[i].size()==1){
      |            ^~
      |            tm