12 条题解
信息
- ID
- 39
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- 递交数
- 3852
- 已通过
- 1060
- 上传者
#include<stdio.h>
int main(){
int n,a,t1=1,t=1;
scanf("%d",&a);
n=a-1;
int sum =1;
for(int i=1;i<=n/2;i++){
t1*=i;
t=1;
for(int j=n-i;j>n-i*2;j--){
t*=j;
}
t/=t1;
sum+=t;
}
printf("%d",sum);
return 0;
}
大三老学姐突然想起这题,当时是用组合数写的,写了个博客https://blog.csdn.net/m0_66846336/article/details/154492185?fromshare=blogdetail&sharetype=blogdetail&sharerId=154492185&sharerefer=PC&sharesource=m0_66846336&sharefrom=from_link 看不懂的同学可以去这,里面有解释(这个题解的代码充满了当年的萌新感,太shi了)