Submission #525780

#TimeUsernameProblemLanguageResultExecution timeMemory
525780Hanksburger콤보 (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string tmp, ans; string guess_sequence(int n) { int res1=press("AB"); if (res1) { int res2=press("A"); if (res2) { ans.append("A"); for (int i=2; i<n; i++) { tmp.clear(); tmp.append(ans); tmp.append("BB"); tmp.append(ans); tmp.append("BX"); tmp.append(ans); tmp.append("BY"); tmp.append(ans); tmp.append("X"); int res=press(tmp); if (res==i-1) ans.append("Y"); else if (res==i) ans.append("X"); else ans.append("B"); } tmp.clear(); tmp.append(ans); tmp.append("B"); int res3=press(tmp); tmp.clear(); tmp.append(ans); tmp.append("X"); int res4=press(tmp); if (res3==n) ans.append("B"); else if (res4==n) ans.append("X"); else ans.append("Y"); } else { ans.append("B"); for (int i=2; i<n; i++) { tmp.clear(); tmp.append(ans); tmp.append("AA"); tmp.append(ans); tmp.append("AX"); tmp.append(ans); tmp.append("AY"); tmp.append(ans); tmp.append("X"); int res=press(tmp); if (res==i-1) ans.append("Y"); else if (res==i) ans.append("X"); else ans.append("A"); } tmp.clear(); tmp.append(ans); tmp.append("A"); int res3=press(tmp); tmp.clear(); tmp.append(ans); tmp.append("X"); int res4=press(tmp); if (res3==n) ans.append("A"); else if (res4==n) ans.append("X"); else ans.append("Y"); } } else { int res2=press("X"); if (res2) { ans.append("X"); for (int i=2; i<n; i++) { tmp.clear(); tmp.append(ans); tmp.append("AA"); tmp.append(ans); tmp.append("AB"); tmp.append(ans); tmp.append("AY"); tmp.append(ans); tmp.append("B"); int res=press(tmp); if (res==i-1) ans.append("Y"); else if (res==i) ans.append("B"); else ans.append("A"); } tmp.clear(); tmp.append(ans); tmp.append("A"); int res3=press(tmp); tmp.clear(); tmp.append(ans); tmp.append("B"); int res4=press(tmp); if (res3==n) ans.append("A"); else if (res4==n) ans.append("B"); else ans.append("Y"); } else { ans.append("Y"); for (int i=2; i<n; i++) { tmp.clear(); tmp.append(ans); tmp.append("AA"); tmp.append(ans); tmp.append("AB"); tmp.append(ans); tmp.append("AX"); tmp.append(ans); tmp.append("B"); int res=press(tmp); if (res==i-1) ans.append("X"); else if (res==i) ans.append("B"); else ans.append("A"); } tmp.clear(); tmp.append(ans); tmp.append("A"); int res3=press(tmp); tmp.clear(); tmp.append(ans); tmp.append("B"); int res4=press(tmp); if (res3==n) ans.append("A"); else if (res4==n) ans.append("B"); else ans.append("X"); } } return ans; }

Compilation message (stderr)

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