Submission #164329

#TimeUsernameProblemLanguageResultExecution timeMemory
164329aggu_01000101Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <string> #include <unordered_map> #include <cstring> #include <chrono> #include <vector> #include <map> #include <random> #include <set> #include <algorithm> #include <math.h> #include <cstdio> #include <stdio.h> #include <assert.h> #include <queue> #include <bitset> #include <cstdlib> #include <deque> #include <cassert> #include <stack> #include "combo.h" using namespace std; string guess_sequence(int N) { char lol[] = {'A', 'B', 'X', 'Y'}; int taken = 0; while(press("" + lol[taken])==0) taken++; string s = "" + lol[taken]; for(int i = 1;i<n;i++){ for(int j = 0;j<4;j++){ if(j==taken) continue; int rn = press(s + lol[j]); if(rn==(i+1)){ s = s+lol[j]; j = 5; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:28:21: error: 'n' was not declared in this scope
   28 |     for(int i = 1;i<n;i++){
      |                     ^