Submission #1249372

#TimeUsernameProblemLanguageResultExecution timeMemory
1249372khoavn2008콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h"

#include <bits/stdc++.h>
using namespace std;
#define ll int
#define ld double
#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define REP(i,r) for(ll i=0,_r=(r);i<_r;i++)
#define FOR(i,l,r) for(ll i=(l),_r=(r);i<=_r;i++)
#define FORE(i,v) for(__typeof((v).begin()) i=(v).begin();i!=(v).end();i++)
#define FORNG(i,r,l) for(ll i=(r),_l=(l);i>=_l;i--)
#define MASK(i) (1LL<<(i))
#define BIT(x,i) (((x)>>(i))&1LL)
#define all(v) (v).begin(),(v).end()
#define size(v) ((ll)(v).size())

char ch[] = {'A', 'B', 'X', 'Y'};
string guess_sequence(int N) {
    string p = "";
    FOR(i,1,n){
        REP(j,4){
            p += ch[j];
            if(press(p) == i)break;
            p.pop_back();
        }
    }
    return p;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:13: error: 'n' was not declared in this scope
   23 |     FOR(i,1,n){
      |             ^
combo.cpp:12:37: note: in definition of macro 'FOR'
   12 | #define FOR(i,l,r) for(ll i=(l),_r=(r);i<=_r;i++)
      |                                     ^