Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- short n,m,d[1001][1001];
- int main()
- {
- ifstream f("cladire.in");
- ofstream g("cladire.out");
- f>>n>>m;
- for(int i=1;i<=n;i++){
- d[i][1]=1;
- }
- for(int j=1;j<=m;j++){
- d[1][j]=1;
- }
- for(int i=2;i<=n;i++){
- for(int j=2;j<=m;j++){
- d[i][j]=(d[i-1][j]+d[i][j-1])%9901;
- ///cout<<d[i][j]<<" ";
- }
- ///cout<<endl;
- }
- g<<d[n][m];
- return 0;
- }
Add Comment
Please, Sign In to add comment