Submission #91434

#TimeUsernameProblemLanguageResultExecution timeMemory
91434SaboonCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define F first #define S second #define PB push_back #define PF push_front #define MP make_pair using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; const int maxn = 2e5 + 10; map <int, char> mp; string guess_sequence(int n){ mp[0] = 'A'; mp[1] = 'B'; mp[2] = 'X'; mp[3] = 'Y'; string t; if (press("AB") == 1){ if (press("A") == 1) throw; else swap(mp[0], mp[1]); } else{ if (press("X") == 1) swap(mp[0], mp[2]); else swap(mp[0], mp[3]); } t += mp[0]; for (int i = 2; i <= n - 1; i++){ string s = t + mp[1] + mp[1] + t + mp[1] + mp[2] + t + mp[1] + mp[3] + t + mp[2]; int x = press(s); if (x == i + 1) t += mp[1]; else if (x == i) t += mp[2]; else t += mp[3]; } if (press(t + mp[1] + t + mp[2]) == n){ if (press(t + mp[1]) == n) t += mp[1]; else t += mp[2]; } else t += mp[3]; return t; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:22:6: error: 'press' was not declared in this scope
   22 |  if (press("AB") == 1){
      |      ^~~~~
combo.cpp:37:11: error: 'press' was not declared in this scope
   37 |   int x = press(s);
      |           ^~~~~
combo.cpp:45:6: error: 'press' was not declared in this scope
   45 |  if (press(t + mp[1] + t + mp[2]) == n){
      |      ^~~~~