Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <cstring>#include <string>using namespace std;int n, m;char maze[110][110];int dpdown[110][110];int dpright[110][110];int min(int i1, int i2){return i1 < i2 ? i1 : i2;}void solve(){memset(dpright, 0, sizeof(dpright));memset(dpdown, 0, sizeof(dpdown));if(maze[0][0] == 'b'){dpdown[0][0] = 1;dpright[0][0] = 1;}for(int i = 1; i < m; i++){if(maze[0][i] == 'b'){dpright[0][i] = dpright[0][i - 1] + 1;}else{dpright[0][i] = dpright[0][i - 1];}