제출 #207454

#제출 시각아이디문제언어결과실행 시간메모리
207454aloo123콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #define ld long double #define f first #define s second #define mp make_pair #define pb push_back #define vll vector<ll> using namespace std; const ll N = 3e5+100; const ll MOD = 1e9+7; string guess_sequence(int N){ char c; for(char lol :{'X','Y','A','B'}){ string s; s+=lol; if(press(s) == 1){ c=lol; break; } } string s; s += c; for(int i = 1;i<N-1;i++){ string query = s; if(c == 'A'){ query += "B"; query+=s; query+="XB"; query+=s; query += "XX"; query += s; query += "XY"; int lol = press(query); int n = s.size(); if(lol == n){ s += "Y"; } if(lol == (n+1)){ s += "B"; } if(lol == (n+2)){ s += "X"; } } if(c == 'B'){ query += "A"; query+=s; query+="XA"; query+=s; query += "XX"; query += s; query += "XY"; int lol = press(query); int n = s.size(); if(lol == n){ s += "Y"; } if(lol == (n+1)){ s += "A"; } if(lol == (n+2)){ s += "X"; } } if(c == 'X'){ query += "Y"; query+=s; query+="AY"; query+=s; query += "AA"; query += s; query += "AB"; int lol = press(query); int n = s.size(); if(lol == n){ s += "B"; } if(lol == (n+1)){ s += "Y"; } if(lol == (n+2)){ s += "A"; } } if(c == 'Y'){ query += "X"; query+=s; query+="AX"; query+=s; query += "AA"; query += s; query += "AB"; int lol = press(query); int n = s.size(); if(lol == n){ s += "B"; } if(lol == (n+1)){ s += "X"; } if(lol == (n+2)){ s += "A"; } } } char cc; for(char lol :{'X','Y','A','B'}){ string ss; ss+=lol; if(press(ss) == 1){ cc=lol; break; } } s += cc; return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:6: error: 'press' was not declared in this scope
   20 |   if(press(s) == 1){
      |      ^~~~~
combo.cpp:38:14: error: 'press' was not declared in this scope
   38 |    int lol = press(query);
      |              ^~~~~
combo.cpp:59:14: error: 'press' was not declared in this scope
   59 |    int lol = press(query);
      |              ^~~~~
combo.cpp:79:14: error: 'press' was not declared in this scope
   79 |    int lol = press(query);
      |              ^~~~~
combo.cpp:99:14: error: 'press' was not declared in this scope
   99 |    int lol = press(query);
      |              ^~~~~
combo.cpp:117:6: error: 'press' was not declared in this scope
  117 |   if(press(ss) == 1){
      |      ^~~~~