Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- const int N = 1e3 + 5;
- const int mod = 1e9 + 7;
- int dp[N][N];
- char a[N][N];
- signed main()
- {
- int n;
- cin >> n;
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= n; j++){
- cin >> a[i][j];
- }
- }
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= n; j++){
- if(a[i][j] == '*')
- continue;
- if((i == 1) && (j == 1)){
- dp[i][j] = 1;
- continue;
- }
- dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
- dp[i][j] %= mod;
- }
- }
- cout << dp[n][n] << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement