728x90
programmers.co.kr/learn/courses/30/lessons/42898
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(int m, int n, vector<vector<int>> puddles) {
int answer = 0;
int map[105][105] = {0,};
for(int j=1; j<=m; j++){
map[1][j] = 1;
}
for(int i=1; i<=n; i++){
map[i][1]=1;
}
for(int i=0; i<puddles.size(); i++){
int y = puddles[i][0];
int x = puddles[i][1];
map[x][y] = -1; //개수
}
for(int p=1; p<=n; p++){
for(int q=1; q<=m; q++){
if(p==1 && q==1){continue;}
if(map[p][q]!=-1){
map[p][q]= (map[p-1][q]+ map[p][q-1])%1000000007;
}
else{map[p][q]=0;}
}
}
answer = map[n][m];
return answer;
}