제출 #203595

#제출 시각아이디문제언어결과실행 시간메모리
203595Tadiorn콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; /*int press(string looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooool); { }*/ string guess_sequence(int N) { string f; int te = /*press("AB")*/; if(te >= 1) { te = press("A"); if(te == 1) { f = "A"; } else { f = "B"; } } else { te = press("X"); if(te == 1) { f = "X"; } else { f = "Y"; } } if(f == "A") { for(int i = 1; i < N - 1; i++) { int t = press(f + "X"+ f + "YB" + f + "YX" + f + "YY"); if(t == (int)f.size()) { f += "B"; } else if(t == (int)f.size() + 1) { f += "X"; } else //if(t == s.size() + 2) { f += "Y"; } } } else if(f == "B") { int t = press(f + "X"+ f + "YA" + f + "YX" + f + "YY"); if(t == (int)f.size()) { f += "A"; } else if(t == (int)f.size() + 1) { f += "X"; } else //if(t == s.size() + 2) { f += "Y"; } } else if(f == "X") { int t = press(f + "A"+ f + "BA" + f + "BB" + f + "BY"); if(t == (int)f.size()) { f += "Y"; } else if(t == (int)f.size() + 1) { f += "A"; } else //if(t == s.size() + 2) { f += "B"; } } else //if(f == "Y") { int t = press(f + "A"+ f + "BA" + f + "BB" + f + "BX"); if(t == (int)f.size()) { f += "X"; } else if(t == (int)f.size() + 1) { f += "A"; } else //if(t == s.size() + 2) { f += "B"; } } te = press(f + "AB"); if(te >= 1) { te = press(f + "A"); if(te == 1) { f = "A"; } else { f = "B"; } } else { te = press(f + "X"); if(te == 1) { f = "X"; } else { f = "Y"; } } return f; } int main() { return 0; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:29: error: expected primary-expression before ';' token
   15 |     int te = /*press("AB")*/;
      |                             ^
combo.cpp:18:14: error: 'press' was not declared in this scope
   18 |         te = press("A");
      |              ^~~~~
combo.cpp:30:14: error: 'press' was not declared in this scope
   30 |         te = press("X");
      |              ^~~~~
combo.cpp:45:21: error: 'press' was not declared in this scope
   45 |             int t = press(f + "X"+ f + "YB" + f + "YX" + f + "YY");
      |                     ^~~~~
combo.cpp:62:17: error: 'press' was not declared in this scope
   62 |         int t = press(f + "X"+ f + "YA" + f + "YX" + f + "YY");
      |                 ^~~~~
combo.cpp:78:17: error: 'press' was not declared in this scope
   78 |         int t = press(f + "A"+ f + "BA" + f + "BB" + f + "BY");
      |                 ^~~~~
combo.cpp:94:17: error: 'press' was not declared in this scope
   94 |         int t = press(f + "A"+ f + "BA" + f + "BB" + f + "BX");
      |                 ^~~~~
combo.cpp:109:10: error: 'press' was not declared in this scope
  109 |     te = press(f + "AB");
      |          ^~~~~