Skip to content

Instantly share code, notes, and snippets.

@htoann
Created June 12, 2022 05:08
Show Gist options
  • Save htoann/c36340deec6774cb13d46de0bdb5155b to your computer and use it in GitHub Desktop.
Save htoann/c36340deec6774cb13d46de0bdb5155b to your computer and use it in GitHub Desktop.
Con Kiến
#include <bits/stdc++.h>
using namespace std;
long long ck_dp1(int m, int n) {
long long * a;
a = new long long[n + 1];
for (int i = 0; i <= n; i++) a[i] = 1;
for (int i = 1; i <= m; i++)
for (int j = 1; j <= n; j++)
a[j] = a[j - 1] + a[j];
return a[n];
}
int main() {
cout << ck_dp1(4, 2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment