P1044 [NOIP2003 普及組] 棧

ruoye123456發表於2024-09-13

include<bits/stdc++.h>

using namespace std;

define x first

define y second

typedef pair<int,int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef vector VS;
typedef vector VI;
typedef vector<vector> VVI;
vector vx;
inline int mp(int x) {return upper_bound(vx.begin(),vx.end(),x)-vx.begin();}
inline int log_2(int x) {return 31-__builtin_clz(x);}
inline int popcount(int x) {return __builtin_popcount(x);}
inline int lowbit(int x) {return x&-x;}
const int N = 1001;
ll C[N][N];
void init_C()
{
for(int i=0;i<N;++i) C[i][0] = 1;
for(int i=1;i<N;++i)
for(int j=1;j<=i;++j)
{
C[i][j] = C[i-1][j] + C[i-1][j-1];
}
}
void solve()
{
init_C();
int n;
cin>>n;
cout<<C[2*n][n]/(n+1)<<'\n';
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int T = 1;
//cin>>T;
while(T--)
{
solve();
}
}

相關文章