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

拆开就行了

Posted by cyy1308947278 at 2015-11-27 19:57:09 on Problem 3181
#include<stdio.h>
#include<string.h>
#include<iostream>
#define ll __int64
#define N 2000
using namespace std;
ll a[N],b[N],inf;
int main()
{
	int n,m,j,i,k,l;
	inf=1;
	for(i=0;i<18;i++)  
    inf*=10;  
	while(~scanf("%d%d",&m,&n))
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		a[0]=1;
		for(i=1;i<=n;i++)
		for(j=i;j<=m;j++)
		{
			
			b[j]=b[j]+b[j-i]+(a[j]+a[j-i])/inf;
			a[j]=(a[j]+a[j-i])%inf;
		}
		if(b[m])
		printf("%I64d",b[m]);
		printf("%I64d\n",a[m]);
	}	
} 

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