Submission #791131

#TimeUsernameProblemLanguageResultExecution timeMemory
791131Pablo_No기지국 (IOI20_stations)C++17
Compilation error
0 ms0 KiB
#include <vector> using namespace std; int count_mushrooms(int n) { std::vector<int> m; if(n == 2) { m = {0, 1}; return 2-use_machine(m); } m = { 0, 1, }; int a = use_machine(m); m = { 0, 2, }; int b = use_machine(m); bool usingb = false; vector<int> hep; int ans = 1 + (1-a) + (1-b); if(a == 0) { hep = { 0, 1 }; } else if(b == 0) { hep = { 0, 2 }; } else { hep = { 1, 2 }; usingb = true; } for(int i = 3; i+1 < n; i += 2) { m = { hep[0], i, hep[1], i+1 }; int def = use_machine(m); def = def%2 + def/2; if(!usingb) def = 2-def; ans += def; } if(n%2 != 1) { m = { 0, n-1 }; int e = use_machine(m); ans += (1-e); } return ans; }

Compilation message (stderr)

stations.cpp: In function 'int count_mushrooms(int)':
stations.cpp:10:12: error: 'use_machine' was not declared in this scope
   10 |   return 2-use_machine(m);
      |            ^~~~~~~~~~~
stations.cpp:13:10: error: 'use_machine' was not declared in this scope
   13 |  int a = use_machine(m);
      |          ^~~~~~~~~~~