Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <numeric>
- using namespace std;
- vector <int> F(13,0);
- int C(int n, int k) {
- return F[n] / (F[k] * F[n - k]);
- }
- int main()
- {
- F[0] = 1;
- for (int i = 1; i < 13; ++i) {
- F[i] = F[i - 1] * i;
- }
- vector <int> v = {C(9,0) * C(9, 4), 3 * C(9, 1) * C(8, 4), 3 * C(9, 2) * C(7, 4), C(9, 3) * C(6, 4)};
- int ans = 0;
- for (int i: v) ans += i;
- cout << ans << "\n";
- cout << C(8, 3) * C(9, 4);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement