제출 #685544

#제출 시각아이디문제언어결과실행 시간메모리
685544Bliznetc콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #pragma GCC optimize("unroll-loops") #pragma GCC optimize("-O3") #pragma GCC target("avx2") using namespace std; #define pb push_back #define sz size() #define all(x) x.begin(), x.end() #define F first #define S second typedef pair < int, int > pii; typedef vector < int > vi; typedef vector < vi > vvi; string guess_sequence (int N) { int n = N; vector<string> a = {"A", "B", "X", "Y"}; int cur = press(a[0] + a[1]); string ans = ""; if (cur != 0) { cur = press(a[0]); if (cur) { ans += a[0]; swap(a[0], a[3]); } else { ans += a[1]; swap(a[1], a[3]); } } else { cur = press(a[2]); if (cur) { ans += a[2]; swap(a[2], a[3]); } else { ans += a[3]; } } for (int i = 2; i < n; i++) { cur = press(ans + a[0] + ans + a[1] + a[0] + ans + a[1] + a[1] + ans + a[1] + a[2]); if (cur == i) { ans += a[0]; } else { if (cur == i + 1) { ans += a[1]; } else { ans += a[2]; } } } cur = press(ans + a[0] + ans + a[1]); if (cur == n) { cur = press(ans + a[0]); if (cur == n) { ans += a[0]; } else { ans += a[1]; } } else { ans += a[2]; } return ans; } //void solve(){ // //} // //signed main() { // ios_base::sync_with_stdio(false); // cin.tie(0); cout.tie(0); // int t = 1; // cin >> t; // while (t--) { // solve(); // cout << "\n"; // } //}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:15: error: 'press' was not declared in this scope
   23 |     int cur = press(a[0] + a[1]);
      |               ^~~~~