Submission #485957

#TimeUsernameProblemLanguageResultExecution timeMemory
485957ala2Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
  string p = "";
  for (int i = 0; i < 4 * N; ++i) {
    p += 'A';
  }
  int coins = press(p);
  string S = "";
  for (int i = 0; i < N; ++i) {
    S += 'A';
  }
  int h=n;
  string ans="";
  for(int i=0;i<h;i++){

  int a=press(ans+"A");
  int b=press(ans+"B");
  int x=press(ans+"X");
  int y=press(ans+"Y");
  if(a==i+1)
  {
      ans+="A";
  }
  if(b==i+1)
  {
      ans+="B";
  }
  if(x==i+1)
  {
      ans+="X";
  }
  if(y==i+1)
  {
      ans+="Y";
  }

  }

  return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:9: error: 'n' was not declared in this scope
   13 |   int h=n;
      |         ^
combo.cpp:8:7: warning: unused variable 'coins' [-Wunused-variable]
    8 |   int coins = press(p);
      |       ^~~~~