This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include<bits/stdc++.h>
usingnamespacestd;
constintN=2010;
constintp=1e9+7;
intc[N][N];
voidinit(){
/*
功能:第0列初始化为1,现实意义:C(n,0)=1
理解:从n个元素中,每次取出0个元素,也就是每次都不取出元素,有几种取法?
很明显只有1种取法,就是什么都不取这样一种情况。类似:C(n,0)=C(n,n)=1
这是递归的base case,如果没有这个1打底,以后再怎么加法原理都是白费
*/
for(inti=1;i<N;i++)c[i][0]=1,c[i][i]=1;// base case