nocows.cpp
来自「USACO chapter two.Useful for beginners.」· C++ 代码 · 共 23 行
CPP
23 行
/*
ID: chenkai4
PROG: nocows
LANG: C++
*/
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("nocows.in");
ofstream out("nocows.out");
int f[201][101],N,K;
int main()
{
in>>N>>K;
for(int a=1;a<=K;a++)
f[1][a]=1;
for(int a=3;a<=N;a+=2)
for(int b=1;b<=K;b++)
for(int c=1;c<=a-2;c++)
f[a][b]=(f[a][b]+f[c][b-1]*f[(a-1)-c][b-1])%9901;
out<<((f[N][K]-f[N][K-1]+9901)%9901)<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?