#include using namespace std; typedef long long ll; typedef unsigned long long ull; int H,W; vector grid; int solve(int y, int x, int jewel){ int ans = 0; if(grid[y][x] == '#'){ return 0; } if(grid[y][x] == 'o'){ jewel++; } if(grid[y][x] == 'x'){ jewel--; if(jewel<0){ return 0; } } if(y == H-1 && x == W-1){ return 1; } //下に行く if(y> H >> W; for(int i=0;i> s; grid.push_back(s); } int ans = solve(0,0,0); cout << ans << endl; }