제출 #331257

#제출 시각아이디문제언어결과실행 시간메모리
331257pggp콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> //#include "combo.h" using namespace std; string guess_sequence(int N){ string cur = ""; string first = ""; if(press("A") == 1){ cur = "A"; } else if(press("B") == 1){ cur = "B"; } else if(press("X") == 1){ cur = "X"; } else{ cur = "Y"; } first = cur; for (int i = 0; i < N; ++i) { if(first == "A"){ int a = press(cur + "XY" + cur + "XX" + cur + "XB" + cur + "Y"); cout << a << endl; if(a == cur.size()){ cur = cur + "B"; } if(a == cur.size() + 1){ cur = cur + "Y"; } if(a == cur.size() + 2){ cur = cur + "X"; } } if(first == "B"){ int a = press(cur + "XY" + cur + "XX" + cur + "XA" + cur + "Y"); if(a == cur.size()){ cur = cur + "A"; } if(a == cur.size() + 1){ cur = cur + "Y"; } if(a == cur.size() + 2){ cur = cur + "X"; } } if(first == "X"){ int a = press(cur + "AY" + cur + "AA" + cur + "AB" + cur + "Y"); if(a == cur.size()){ cur = cur + "B"; } if(a == cur.size() + 1){ cur = cur + "Y"; } if(a == cur.size() + 2){ cur = cur + "A"; } } if(first == "Y"){ int a = press(cur + "XA" + cur + "XX" + cur + "XB" + cur + "A"); if(a == cur.size()){ cur = cur + "B"; } if(a == cur.size() + 1){ cur = cur + "A"; } if(a == cur.size() + 2){ cur = cur + "X"; } } } return cur; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:5: error: 'press' was not declared in this scope
   14 |  if(press("A") == 1){
      |     ^~~~~
combo.cpp:31:12: error: 'press' was not declared in this scope
   31 |    int a = press(cur + "XY" + cur + "XX" + cur + "XB" + cur + "Y");
      |            ^~~~~
combo.cpp:33:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |    if(a == cur.size()){
      |       ~~^~~~~~~~~~~~~
combo.cpp:36:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |    if(a == cur.size() + 1){
      |       ~~^~~~~~~~~~~~~~~~~
combo.cpp:39:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |    if(a == cur.size() + 2){
      |       ~~^~~~~~~~~~~~~~~~~
combo.cpp:44:12: error: 'press' was not declared in this scope
   44 |    int a = press(cur + "XY" + cur + "XX" + cur + "XA" + cur + "Y");
      |            ^~~~~
combo.cpp:45:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |    if(a == cur.size()){
      |       ~~^~~~~~~~~~~~~
combo.cpp:48:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |    if(a == cur.size() + 1){
      |       ~~^~~~~~~~~~~~~~~~~
combo.cpp:51:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   51 |    if(a == cur.size() + 2){
      |       ~~^~~~~~~~~~~~~~~~~
combo.cpp:56:12: error: 'press' was not declared in this scope
   56 |    int a = press(cur + "AY" + cur + "AA" + cur + "AB" + cur + "Y");
      |            ^~~~~
combo.cpp:57:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |    if(a == cur.size()){
      |       ~~^~~~~~~~~~~~~
combo.cpp:60:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |    if(a == cur.size() + 1){
      |       ~~^~~~~~~~~~~~~~~~~
combo.cpp:63:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |    if(a == cur.size() + 2){
      |       ~~^~~~~~~~~~~~~~~~~
combo.cpp:68:12: error: 'press' was not declared in this scope
   68 |    int a = press(cur + "XA" + cur + "XX" + cur + "XB" + cur + "A");
      |            ^~~~~
combo.cpp:69:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   69 |    if(a == cur.size()){
      |       ~~^~~~~~~~~~~~~
combo.cpp:72:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   72 |    if(a == cur.size() + 1){
      |       ~~^~~~~~~~~~~~~~~~~
combo.cpp:75:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   75 |    if(a == cur.size() + 2){
      |       ~~^~~~~~~~~~~~~~~~~