제출 #526455

#제출 시각아이디문제언어결과실행 시간메모리
526455perchuts콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define maxn (int)(1e5+51) #define all(x) x.begin(), x.end() #define sz(x) (int) x.size() #define endl '\n' #define ll long long #define pb push_back #define ull unsigned long long #define ii pair<int,int> #define iii tuple<int,int,int> #define inf 2000000001 #define mod 1000000007 //998244353 #define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); using namespace std; template<typename X, typename Y> bool ckmin(X& x, const Y& y) { return (y < x) ? (x=y,1):0; } template<typename X, typename Y> bool ckmax(X& x, const Y& y) { return (x < y) ? (x=y,1):0; } char b[4]={'A','B','X','Y'}; string guess_sequence(int n){ string ans = ""; char first; int q = press("AB"); if(q==1)first='B'; else if(q==2)first='A'; else{ q = press("XY"); if(q==1)first='Y'; else first='X'; } ans+=first; string um,dois,last,x1,x2,x3; for(int i=0;i<4;++i){ if(b[i]==first)continue; if(!sz(um))um += b[i]; else if(!sz(dois))dois += b[i]; else last += b[i]; } x1+=um+um,x2+=um+dois,x3+=um+last; for(int i=3;i<=n;++i){ string query = ""; query+=ans+dois; query+=ans+x1; query+=ans+x2; query+=ans+x3; q = press(query); if(q==0)ans+=last; else if(q==i)ans+=um; else ans+=dois; } string query=""; query+=ans+um; query+=ans+dois; q = press(query); if(q==n){ if(press(ans+um)==n)ans+=um; else ans+=dois; }else ans+=last; return ans; }

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

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