Submission #987264

#TimeUsernameProblemLanguageResultExecution timeMemory
987264mateuszwesCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; #define F first #define S second #define pb push_back using namespace std; constexpr int debug = 0; string guess_sequence(int n){ vector<char> usable; string curr = ""; int a1 = press("AB"); if(a1){ a1 = press("AXAY"); (a1 >= 1) ? curr = "A" : curr = "B"; } else{ a1 = press("XAXB"); (a1 >= 1) ? curr = "X" : curr = "Y"; } vector<char> all = {'A', 'B', 'X', 'Y'}; for(auto k: all){ if(k != curr[0]) usable.pb(k); } string tochek = ""; for(int i = 2; i < n; i++){ //iteracja po dlugosci tochek = curr + usable[0]; for(int j = 0; j < 3; j++) tochek += (curr + usable[1] + usable[j]); a1 = press(tochek); if(a1-curr.size() == 2) curr += usable[1]; else if(a1-curr.size()) curr += usable[0]; else curr += usable[2]; } if(n >= 2){ tochek = curr + usable[0] + curr + usable[1]; a1 = press(tochek)-curr.size(); tochek = curr + usable[1] + curr + usable[2]; int a2 = press(tochek)-curr.size(); if(a1 && a2) curr += usable[1]; else if(a1) curr += usable[0]; else curr += usable[2]; } return curr; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:14: error: 'press' was not declared in this scope
   16 |     int a1 = press("AB");
      |              ^~~~~