Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么总是超时?好诡异!那位COW帮忙看看

Posted by guogaoan at 2010-05-02 14:08:45 on Problem 1942 and last updated at 2010-05-02 17:37:00
#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    __int64 n,m,ans,i,j;
    while((scanf("%I64d%I64d",&n,&m)) && !(n==0 && m==0)){
        ans=1;
        for(i=n+m,j=1;i>=m+1;j++,i--)
        ans=ans*i/j;
        printf("%I64d\n",ans);
    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator