Submission #232228

#TimeUsernameProblemLanguageResultExecution timeMemory
232228pere_gilCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" #include <iostream> using namespace std; string guess_sequence(){ string s=""; string re=""; if(press("A")){ s="A"; re="BXY"; } else{ if(press("B")){ s="B"; re="AXY"; } else{ if(press("X")){ s="X"; re="ABY"; } else{ s="Y"; re="ABX"; } } } bool ja; for(int i=0;i<N;i++){ ja=true; if(ja and press(s+re[0])>0){ s+=re[0]; ja=false; } if(ja and press(s+re[1])>0){ s+=re[1]; ja=false; } if(ja and press(s+re[2])>0){ s+=re[2]; ja=false; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence()':
combo.cpp:30:19: error: 'N' was not declared in this scope
   30 |     for(int i=0;i<N;i++){
      |                   ^