제출 #236187

#제출 시각아이디문제언어결과실행 시간메모리
236187davi_bart콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; #define o_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> #define int ll mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); string guess_sequence(int N){ vector<char> k={'A','B','X','Y'}; string sol=""; int a=press("AB"); if(a){ int b=press("A"); if(b){ sol="A"; k.erase(k.begin()); }else{ sol="B"; k.erase(k.begin()+1); } }else{ int b=press("C"); if(b){ sol="C"; k.erase(k.begin()+2); }else{ sol="D"; k.erase(k.begin()+3); } } for(int i=1;i<N;i++){ int z=press(sol+k[0]+k[0]+sol+k[0]+k[1]+sol+k[0]+k[2]+sol+k[1]); if(z==i)sol+=k[2]; else if(z==(i+1))sol+=k[1]; else sol+=k[0]; } return sol; } /* signed main(){ ios_base::sync_with_stdio(0);cin.tie(0); cout<<guess_sequence(5); }*/

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

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