제출 #136682

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1366822019-07-26 07:01:38WongHokFong_cpp콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <cstdio>
#include "combo.h"
#include <string>
using namespace std;
string a,b,c;
int visited[5];
string guess_sequence(int N)
{
string ans;
if (press("AB")>=1)
{
if (press("A")==1)
{
ans+="A";
a="B",b="X",c="Y";
}
else
{
ans+="B";
a="A",b="X",c="Y";
}
}
else
{
if (press("X")==1)
{
ans+="X";
a="A",b="B",c="Y";
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:37:18: error: 'n' was not declared in this scope
   37 |  for (int i=2;i<=n-1;i++)
      |                  ^
combo.cpp:45:11: error: 'n' was not declared in this scope
   45 |  if (rec==n)
      |           ^
combo.cpp:49:6: error: redeclaration of 'int rec'
   49 |  int rec=press(ans+b);
      |      ^~~
combo.cpp:44:6: note: 'int rec' previously declared here
   44 |  int rec=press(ans+a);
      |      ^~~
combo.cpp:50:11: error: 'n' was not declared in this scope
   50 |  if (rec==n)
      |           ^