Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int stol_0, strok_0, s = 0;
- cin >> stol_0 >> strok_0;
- vector<vector<int> >ans(9, vector<int>(9, 0));
- ans[strok_0][stol_0] = 1;
- for(int strok = strok_0 + 1; strok <= 8; strok++){
- for(int stol = 1; stol <= 8; stol++){
- ans[strok][stol] = ans[strok - 1][stol - 1]+ans[strok - 1][stol + 1];
- }
- }
- for(int i = 1; i <= 8; i++) s += ans[8][i];
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement