Submission #90989

#TimeUsernameProblemLanguageResultExecution timeMemory
90989too_stupidCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
  string p = "";
  
   string k = "XYZ";
  if(press("A"))
  {
    p+="A";
  	for(int i = 1 ; i < 4 * n ; i++)
  	{
  		for(int j = 0 ; j < 3 ; ++j)
  		{
  			if(press(p + k[j]) == (int)p.size() + 1)
  			{
  				p+=k[j];
  				break;
  			}
  		}
  	}

  }

  else if(press("B"))
  {
  	p+="B";
for(int i = 1 ; i < 4 * n ; i++)
  	{
  		for(int j = 0 ; j < 3 ; ++j)
  		{
  			if(press(p + k[j]) == (int)p.size() + 1)
  			{
  				p+=k[j];
  				break;
  			}
  		}
  	}
  }
  else if(press("X"))
  {
  	p+="X";
for(int i = 1 ; i < 4 * n ; i++)
  	{
  		for(int j = 0 ; j < 3 ; ++j)
  		{
  			if(press(p + k[j]) == (int)p.size() + 1)
  			{
  				p+=k[j];
  				break;
  			}
  		}
  	}
  }
  else
  {
  	p+="Y";
for(int i = 1 ; i < 4 * n ; i++)
  	{
  		for(int j = 0 ; j < 3 ; ++j)
  		{
  			if(press(p + k[j]) == (int)p.size() + 1)
  			{
  				p+=k[j];
  				break;
  			}
  		}
  	}
  }
  
  return S;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:28: error: 'n' was not declared in this scope
   10 |    for(int i = 1 ; i < 4 * n ; i++)
      |                            ^
combo.cpp:27:25: error: 'n' was not declared in this scope
   27 | for(int i = 1 ; i < 4 * n ; i++)
      |                         ^
combo.cpp:42:25: error: 'n' was not declared in this scope
   42 | for(int i = 1 ; i < 4 * n ; i++)
      |                         ^
combo.cpp:57:25: error: 'n' was not declared in this scope
   57 | for(int i = 1 ; i < 4 * n ; i++)
      |                         ^
combo.cpp:70:10: error: 'S' was not declared in this scope
   70 |   return S;
      |          ^