rotti321

cladire

Oct 24th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. short n,m,d[1001][1001];
  5. int main()
  6. {
  7. ifstream f("cladire.in");
  8. ofstream g("cladire.out");
  9. f>>n>>m;
  10. for(int i=1;i<=n;i++){
  11. d[i][1]=1;
  12. }
  13. for(int j=1;j<=m;j++){
  14. d[1][j]=1;
  15. }
  16. for(int i=2;i<=n;i++){
  17. for(int j=2;j<=m;j++){
  18. d[i][j]=(d[i-1][j]+d[i][j-1])%9901;
  19. ///cout<<d[i][j]<<" ";
  20. }
  21. ///cout<<endl;
  22. }
  23. g<<d[n][m];
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment