제출 #1167426

#제출 시각아이디문제언어결과실행 시간메모리
1167426henriess카멜레온의 사랑 (JOI20_chameleon)C++20
컴파일 에러
0 ms0 KiB
//#include "chameleon.h" #include <bits/stdc++.h> using namespace std; void Solve(int N) { //if N is less than 7 //I can brute force //N <= 7, that means //I can hold a meeting of 2 chameleons //if 1 chameleons likes the other chameleon and the other chameleon does not, there will be 1 distinct color //if both chameleons like each other, there will be 2 distinct colors //ok wtv let's do st 1 first, where the both chameleons love each other vector<pair<long long,long long>> pairs; for(int i = 1;i<=2*N;i++){ vector<int> qry(2); qry[0] = i; for(int j = i+1;j<= 2* N;j++){ qry[1] = j; long long r = Query(qry); if (r == 1){//that means 1 chameleon likes the other chameleon and that means both of them are originally different colors //or both chameleons have the same color //how do I differentiate between both situations //when both chameleons love each other, there will be 2 different colors pairs.push_back({i,j}); } } } for(int i = 0;i<pairs.size();i++){ Answer(pairs[i].first,pairs[i].second); } }

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

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:21:39: error: 'Query' was not declared in this scope
   21 |                         long long r = Query(qry);
      |                                       ^~~~~
chameleon.cpp:34:17: error: 'Answer' was not declared in this scope
   34 |                 Answer(pairs[i].first,pairs[i].second);
      |                 ^~~~~~