提交时间:2023-11-25 09:44:43

运行 ID: 112019

#include<bits/stdc++.h> using namespace std; int a[1001][1001]; signed main(){ int n,m; cin >> n >> m; for(int i = 1;i <= n;i++){ for(int j = 1;j <= m;j++){ cin >> a[i][j]; if(a[i][j] == 0){ a[i][j] = 1; }else{ a[i][j] = 0; } } } for(int i = 2;i <= n;i++){ for(int j = 2;j <= m;j++){ if(a[i][j] != 0){ a[i][j] = a[i][j-1]+a[i-1][j]; } } } cout << a[n][m]; }