int n;
set< pair< int , int >> st;
void solve( int i, int x, int y, int turn) {
if ( i == n)
{
st.insert ( { x, y} ) ;
return ;
}
if ( turn == 1 || turn == 0 )
{
solve( i + 1 , x, y + 1 , 2 ) ;
solve( i + 1 , x, y - 1 , 2 ) ;
}
if ( turn == 2 || turn == 0 )
{
solve( i + 1 , x + 1 , y, 1 ) ;
solve( i + 1 , x - 1 , y, 1 ) ;
}
}
//let n be the number of moves
//call solve(0, 0, 0, 0);
//Answer is st.size();
aW50IG47CnNldDxwYWlyPGludCwgaW50Pj4gc3Q7CnZvaWQgc29sdmUoaW50IGksIGludCB4LCBpbnQgeSwgaW50IHR1cm4pewogICAgaWYoaSA9PSBuKQogICAgewogICAgICAgIHN0Lmluc2VydCh7eCwgeX0pOwogICAgICAgIHJldHVybjsKICAgIH0KIAogCiAgICBpZih0dXJuID09IDEgfHwgdHVybiA9PSAwKQogICAgewogICAgICAgIHNvbHZlKGkgKyAxLCB4LCB5ICsgMSwgMik7CiAgICAgICAgc29sdmUoaSArIDEsIHgsIHkgLSAxLCAyKTsKICAgIH0KICAgIGlmKHR1cm4gPT0gMiB8fCB0dXJuID09IDApCiAgICB7CiAgICAgICAgc29sdmUoaSArIDEsIHggKyAxLCB5LCAxKTsKICAgICAgICBzb2x2ZShpICsgMSwgeCAtIDEsIHksIDEpOwogICAgfQp9CgovL2xldCBuIGJlIHRoZSBudW1iZXIgb2YgbW92ZXMKLy9jYWxsIHNvbHZlKDAsIDAsIDAsIDApOwovL0Fuc3dlciBpcyBzdC5zaXplKCk7
compilation info
prog.cpp:2:1: error: ‘set’ does not name a type
set<pair<int, int>> st;
^~~
prog.cpp: In function ‘void solve(int, int, int, int)’:
prog.cpp:6:9: error: ‘st’ was not declared in this scope
st.insert({x, y});
^~
prog.cpp:6:9: note: suggested alternative: ‘std’
st.insert({x, y});
^~
std
stdout