답안 #923526

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
923526 2024-02-07T11:34:22 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:1:10: warning: missing terminating " character
    1 | #include "bits/stdc++.h>
      |          ^
chameleon.cpp:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include "bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
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
   19 |                 to[i].push_back(f);
      |                 ^~
chameleon.cpp:26:12: error: 'to' was not declared in this scope
   26 |         if(to[i].size()==1){
      |            ^~