mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
This commit is contained in:
parent
3fc75f01f2
commit
495bb21001
18
NYOJ/912.cpp
Normal file
18
NYOJ/912.cpp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#include <cstdio>
|
||||||
|
long long px[16];
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
px[1]=0;
|
||||||
|
px[2]=1;
|
||||||
|
px[3]=2;
|
||||||
|
for(int i=4;i<16;i++)
|
||||||
|
{
|
||||||
|
px[i]=(i-1)*(px[i-1]+px[i-2]);
|
||||||
|
}
|
||||||
|
int t;
|
||||||
|
while(scanf("%d",&t)==1)
|
||||||
|
{
|
||||||
|
printf("%lld\n",px[t]);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user