제출 #1108215

#제출 시각아이디문제언어결과실행 시간메모리
1108215hainam2k9콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define tt cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0) #define fo freopen((NAME+".INP").c_str(), "r", stdin), freopen((NAME+".OUT").c_str(), "w", stdout) #define ll long long #define ull unsigned long long #define i128 __int128 #define db long double #define sz(a) ((int)(a).size()) #define pb emplace_back #define pf emplace_front #define pob pop_back #define pof pop_front #define lb lower_bound #define ub upper_bound #define fi first #define se second #define ins emplace using namespace std; const int MOD = 1e9+7, MAXN = 1e5+5; const string NAME = ""; //int press(string p){ // if(sz(p)>20){ // cout << "TOO BIG"; // exit(0); // } // cout << p << endl; // int x; // cin >> x; // return x; //} string guess_sequence(int n){ string s,x="ABXY"; if(press("AB")){ if(press("B")) s='B'; else s='A'; }else if(press("X")) s='X'; else s="Y"; for(int i = 0; i<sz(x); ++i) if(x[i]==s[0]) x.erase(i,1); while(sz(s)<n){ string query=s+x[0]+x[1]+s+x[0]+x[2]+s+x[1]; int tmp=press(query); if(tmp==sz(s)+2) s+=x[0]; else if(tmp==sz(s)+1) s+=x[1]; else s+=x[2]; } return s; } //int main() //{ // cout << guess_sequence(5); //}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:33:8: error: 'press' was not declared in this scope
   33 |     if(press("AB")){
      |        ^~~~~
combo.cpp:42:17: error: 'press' was not declared in this scope
   42 |         int tmp=press(query);
      |                 ^~~~~