| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
直接扫会超时,需要处理下k#include<cstdio>
typedef long long ll;
int main()
{
int n,k;
while(scanf("%d%d",&n,&k) && n+k){
ll ans=1;
if(k>n/2) k=n-k;
for(int i=1;i<=k;++i)
ans=ans*(n-i+1)/i;
printf("%lld\n",ans);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator