Submission #737777

#TimeUsernameProblemLanguageResultExecution timeMemory
737777Elvin_FritlCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "combo.h" string guess_sequence(int N) { string s; vector<char>v; if(press("A")==1){ s+='A'; v.push_back('B'); v.push_back('Y'); v.push_back('X'); } else if(press("B")==1){ s+='B'; v.push_back('A'); v.push_back('Y'); v.push_back('X'); } else if(press("X")==1){ s+='X'; v.push_back('B'); v.push_back('Y'); v.push_back('A'); } else{ s+='Y'; v.push_back('B'); v.push_back('A'); v.push_back('X'); } for(int i=1;i<n;i++){ for(char i:v){ if(press(s+i)==i+1){ s+=i; break; } } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:33:17: error: 'n' was not declared in this scope
   33 |   for(int i=1;i<n;i++){
      |                 ^
combo.cpp:43:10: error: 'S' was not declared in this scope
   43 |   return S;
      |          ^