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

Please give me some tips!(So easy,but I can't do it very well)

Posted by caojingkun886 at 2011-07-25 20:30:50 on Problem 1942
#include<stdio.h>
int main()
{
    int n,m,ans,i,j;
    while(1){
    scanf("%d%d",&n,&m); if(m==0&&n==0) break;	
        ans=1;
        for(i=n+m,j=1;i>=m+1;j++,i--)
        ans=ans*i/j;
        printf("%d\n",ans);
    }
    return 0;
}
//Time Limit Exceeded

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