제출 #160276

#제출 시각아이디문제언어결과실행 시간메모리
160276MarcoMendoza1콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess_sequence(){ int ax; while(r.size()<(n-1)){ aux=r+arr[2]+r+arr[1]+arr[1]+r+arr[1]+arr[2]+r+arr[1]+arr[3]; ax=press(aux); if(ax==r.size()){ r=r+arr[3]; }else if(ax==(r.size()+1)){ r=r+arr[2]; }else{ r=r+arr[1]; } } if(press(r+arr[1]+r+arr[2])==n){ if(press(r+arr[1])==n){ return r+arr[1]; }else{ return r+arr[2]; } }else{ return r+arr[3]; } }

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

combo.cpp: In function 'std::string guess_sequence()':
combo.cpp:7:11: error: 'r' was not declared in this scope
    7 |     while(r.size()<(n-1)){
      |           ^
combo.cpp:7:21: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     while(r.size()<(n-1)){
      |                     ^
      |                     yn
combo.cpp:8:9: error: 'aux' was not declared in this scope; did you mean 'ax'?
    8 |         aux=r+arr[2]+r+arr[1]+arr[1]+r+arr[1]+arr[2]+r+arr[1]+arr[3];
      |         ^~~
      |         ax
combo.cpp:8:15: error: 'arr' was not declared in this scope
    8 |         aux=r+arr[2]+r+arr[1]+arr[1]+r+arr[1]+arr[2]+r+arr[1]+arr[3];
      |               ^~~
combo.cpp:9:12: error: 'press' was not declared in this scope
    9 |         ax=press(aux);
      |            ^~~~~
combo.cpp:23:14: error: 'r' was not declared in this scope
   23 |     if(press(r+arr[1]+r+arr[2])==n){
      |              ^
combo.cpp:23:16: error: 'arr' was not declared in this scope
   23 |     if(press(r+arr[1]+r+arr[2])==n){
      |                ^~~
combo.cpp:23:8: error: 'press' was not declared in this scope
   23 |     if(press(r+arr[1]+r+arr[2])==n){
      |        ^~~~~
combo.cpp:23:34: error: 'n' was not declared in this scope; did you mean 'yn'?
   23 |     if(press(r+arr[1]+r+arr[2])==n){
      |                                  ^
      |                                  yn