Submission #1167424

#TimeUsernameProblemLanguageResultExecution timeMemory
1167424henriessChameleon's Love (JOI20_chameleon)C++20
Compilation error
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<=N;i++){ vector<int> qry(2); qry[0] = i; for(int j = i+1;j<=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); } }

Compilation message (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);
      |                 ^~~~~~