| ||||||||||
| 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 | |||||||||
大牛们帮忙看一下为什么会runtime error(java)import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class Main
{
public static void main(String args[])
{
int n,k,b,i,j;
BigInteger num[][]=new BigInteger[1101][101];
for(i=1;i<=1101;i++)
for(j=1;j<=100;j++)num[i][j]=new BigInteger("0");
for(i=1;i<=1101;i++)
{
for(j=1;j<=100;j++)
{
if((i==j)||(j==1))num[i][j]=new BigInteger("1");
if(i>j)
{
for(b=1;b<=j;b++)
num[i][j]=num[i][j].add(num[i-j][b]);
}
if(i<j)num[i][j]=new BigInteger("0");
}
}
Scanner sc = new Scanner(System.in);
n=sc.nextInt();k=sc.nextInt();
System.out.println(num[n+k][k]);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator