제출 #101424

#제출 시각아이디문제언어결과실행 시간메모리
101424Utaha콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
/*input */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<double,double> pdd; #define IOS ios_base::sync_with_stdio(0); cin.tie(0) #define ALL(a) a.begin(),a.end() #define SZ(a) ((int)a.size()) #define F first #define S second #define REP(i,n) for(int i=0;i<((int)n);i++) #define pb push_back #define MP(a,b) make_pair(a,b) #define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end())))) #define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin()) template<typename T1,typename T2> ostream& operator<<(ostream& out,pair<T1,T2> P){ out<<'('<<P.F<<','<<P.S<<')'; return out; } //}}} const ll maxn=2005; const ll maxlg=__lg(maxn)+2; const ll INF64=8000000000000000000LL; const int INF=0x3f3f3f3f; const ll MOD=ll(1e9+7); const double PI=acos(-1); //const ll p=880301; //const ll P=31; char c[]={'A','B','X','Y'}; string s[3]; // int press(string s){ // cout<<s<<'\n'; // int ret; // cin>>ret; // return ret; // } string guess_sequence(int n){ string ans; { int tmp=press("AB"); if(tmp){ int meow=press("A"); if(meow) ans.pb('A'); else ans.pb('B'); } else{ int meow=press("X"); if(meow) ans.pb('X'); else ans.pb('Y'); } } { int pt=0; REP(i,4){ if(c[i]==ans[0]) continue; s[pt++].pb(c[i]); } } for(int i=1;i<n-1;i++){ int tmp=press(ans+s[0]+ans+s[1]+s[0]+ans+s[1]+s[1]+ans+s[1]+s[2]); if(tmp==SZ(ans)) ans.pb(s[2][0]); else if(tmp==SZ(ans)+1) ans.pb(s[0][0]); else ans.pb(s[1][0]); } if(press(ans+s[0])==SZ(ans)+1) ans=ans+s[0]; else if(press(ans+s[1])==SZ(ans)+1) ans=ans+s[1]; else ans=ans+s[2]; return ans; } // int main() // { // int n; // cin>>n; // guess_sequence(n); // return 0; // }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:49:11: error: 'press' was not declared in this scope
   49 |   int tmp=press("AB");
      |           ^~~~~
combo.cpp:69:11: error: 'press' was not declared in this scope
   69 |   int tmp=press(ans+s[0]+ans+s[1]+s[0]+ans+s[1]+s[1]+ans+s[1]+s[2]);
      |           ^~~~~
combo.cpp:74:5: error: 'press' was not declared in this scope
   74 |  if(press(ans+s[0])==SZ(ans)+1) ans=ans+s[0];
      |     ^~~~~