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

why wrong answer!!!???

Posted by y05dzz at 2006-04-02 09:20:24 on Problem 2739
#include<iomanip.h>
int d[9000000];
int main()
{
	int b[1500],a[20000],k=0,k3=0,k4=0,m,count=0,i,j;
	for(i=0;i<10000;i++)
	{
		a[i]=1;
	}
	for(i=0;i<1500;i++)
	{
		b[i]=0;
	}
	for(i=2;i<=10000;i++)
	{
		if(a[i]==1)
		{
			b[k++]=i;
			for(j=2;j<10000/i;j++)
			{
				a[j*i]=0;
			}
		}
	}
	for(j=0;j<k;j++)
	{
		for(i=j;i<k;i++)
		{
			d[k3++]=count+b[i];
			count=d[k3-1];
		}
		count=0;
	}
	cin>>m;
	while(m!=0)
	{
		for(i=0;i<k3;i++)
		{
			if(m==d[i])
			{
				k4++;
			}
		}
		cout<<k4<<endl;
		k4=0;
		cin>>m;
	}
	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