Submission #101319

#TimeUsernameProblemLanguageResultExecution timeMemory
101319b2563125Library (JOI18_library)C++14
Compilation error
0 ms0 KiB
#include<iostream> #include<vector> #include<string> #include<stack> #include<queue> #include<utility> #include<algorithm> using namespace std; #define vel vector<int> #define vvel vector<vel> #define vvvel vector<vvel> #define veb vector<bool> void mmax(int &a, int b) { a = max(a, b); } bool che(int i, int j, int n) { vel a(n, 0); a[i] = 1; a[j] = 1; return Query(a) == 1; } void Solve(int n) { if (n == 1) { vel res(1, 1); Answer(res); } vvel con(n); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (che(i, j,n)) { con[i].push_back(j); con[j].push_back(i); } } } int th; for (int i = 0; i < n; i++) { if (con[i].size() == 1) { th = i; } } veb seen(false); seen[th] = true; vel ans(1, th + 1); th = con[th][0]; while (con[th].size() > 1) { ans.push_back(th + 1); if (seen[con[th][0]]) { th = con[th][1]; } else { th = con[th][0]; } } ans.push_back(th + 1); Answer(ans); }

Compilation message (stderr)

library.cpp: In function 'bool che(int, int, int)':
library.cpp:17:9: error: 'Query' was not declared in this scope
  return Query(a) == 1;
         ^~~~~
library.cpp: In function 'void Solve(int)':
library.cpp:20:31: error: 'Answer' was not declared in this scope
  if (n == 1) { vel res(1, 1); Answer(res); }
                               ^~~~~~
library.cpp:41:2: error: 'Answer' was not declared in this scope
  Answer(ans);
  ^~~~~~