Submission #1226099

#TimeUsernameProblemLanguageResultExecution timeMemory
1226099lolokaMinerals (JOI19_minerals)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; void slv(vector<int> v1, vector<int> v2) { if((int)v1.size() == 1) { Answer(v1[0], v2[0]); return; } /*for(auto i : v1) cout << i << " "; cout << "\n"; for(auto i : v2) cout << i << " "; cout << "\n\n";*/ int kl = 0; int n = (int)v1.size(); vector<int> h11, h12, h21, h22; for(int i = 0; i < n / 2; i++) h11.push_back(v1[i]), kl = Query(v1[i]); for(int i = n / 2; i < n; i++) h21.push_back(v1[i]); for(int i = 0; i < n; i++) { int k = Query(v2[i]); if(k == kl) h12.push_back(v2[i]); else h22.push_back(v2[i]); kl = k; } for(int i = 0; i < n / 2; i++) kl = Query(v1[i]); for(int i = 0; i < n; i++) kl = Query(v2[i]); slv(h11, h12), slv(h21, h22); } void Solve(int n) { vector<int> v1, v2; int kl = 0; for(int i = 1; i <= 2 * n; i++) { int k = Query(i); if(k == kl) v2.push_back(i); else v1.push_back(i); kl = k; } for(int i = 1; i < 2 * n; i++) Query(i); slv(v1, v2); }

Compilation message (stderr)

minerals.cpp: In function 'void slv(std::vector<int>, std::vector<int>)':
minerals.cpp:6:17: error: 'Answer' was not declared in this scope
    6 |                 Answer(v1[0], v2[0]);
      |                 ^~~~~~
minerals.cpp:16:67: error: 'Query' was not declared in this scope
   16 |         for(int i = 0; i < n / 2; i++) h11.push_back(v1[i]), kl = Query(v1[i]);
      |                                                                   ^~~~~
minerals.cpp:19:25: error: 'Query' was not declared in this scope
   19 |                 int k = Query(v2[i]);
      |                         ^~~~~
minerals.cpp:24:45: error: 'Query' was not declared in this scope
   24 |         for(int i = 0; i < n / 2; i++) kl = Query(v1[i]);
      |                                             ^~~~~
minerals.cpp:25:41: error: 'Query' was not declared in this scope
   25 |         for(int i = 0; i < n; i++) kl = Query(v2[i]);
      |                                         ^~~~~
minerals.cpp: In function 'void Solve(int)':
minerals.cpp:33:25: error: 'Query' was not declared in this scope
   33 |                 int k = Query(i);
      |                         ^~~~~
minerals.cpp:38:40: error: 'Query' was not declared in this scope
   38 |         for(int i = 1; i < 2 * n; i++) Query(i);
      |                                        ^~~~~