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

Re:超级无敌流氓打表法

Posted by yipingan at 2012-08-03 15:08:49 on Problem 2346
In Reply To:超级无敌流氓打表法 Posted by:luchenqun at 2010-08-06 21:22:48
> 首先,写个程序算出N=2,4,6,8,10时一共有多少张Lucky Tickets。
> 演示一个当N=10有多少张Lucky Tickets。
> #include<iostream>
> using namespace std;
> int main()
> {
> 	int count=0,a,b,c,d,e,f,g,h,i,j;
> 	for(a=0;a<=9;a++)
> 	for(b=0;b<=9;b++)
> 	for(c=0;c<=9;c++)
> 	for(d=0;d<=9;d++)
> 	for(e=0;e<=9;e++)
> 	for(f=0;f<=9;f++)
> 	for(g=0;g<=9;g++)
> 	for(h=0;h<=9;h++)
> 	for(i=0;i<=9;i++)
> 	for(j=0;j<=9;j++)
> 		if(a+b+c+d+e==f+g+h+i+j)
> 			count++;
> 	cout<<count<<endl;
> 	return 0;
> }
> 
> 然后就是流氓打表法:
> #include<iostream>
> using namespace std;
> int main()
> {
> 	int a[]={0,10,670,55252,4816030,432457640},n;
> 	while(cin>>n)
> 		cout<<a[n/2]<<endl;
这个打表不对, 应该是这样的把:
10
10
100
670
6700
55252
552520
4816030
48160300
432457640
> 	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