Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dynamic Programming For Combinatorics - 1
#include <bits/stdc++.h> using namespace std; #define f(i,n) for(int i = 0; i < n; i++) #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define vii vector<pii> #define vll vector<pll> #define vvi vector<vi> #define vvl vector<vl> #define inf INT_MAX #define llinf LONG_LONG_MAX #define F first #define S second #define pb push_back #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define int long long void execute() { int dp[1001][1001]; for(int n = 0; n <= 1000; n++) { dp[n][0] = 1; dp[n][n] = 1; for(int k = 1; k < n; k++) { dp[n][k] = dp[n - 1][k] + dp[n - 1][k - 1]; } } for(int n = 0; n <= 1000; n++) { for(int k = 0; k <= n; k++) { cout << dp[n][k] << " "; } cout << "\n"; } } void solve() { execute(); } signed main() { fast; int t; cin >> t; while(t--) { solve(); } return 0; }
run
|
edit
|
history
|
help
0
Test 5(2020)
Test 20(2020)
BST to DLL
binder
kadane's algorithm
queue-with-fixed-size
finding factor
23 2.5
Kishan_Basic_Geometry
Eratosfen final