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 a8221379 at 2011-08-11 14:41:20 on Problem 1664
#include<iostream>
using namespace std;
int main()
{
	int a[10][10] = {1,1,1,1,1,1,1,1,1,1,
1,2,2,2,2,2,2,2,2,2,
1,2,3,3,3,3,3,3,3,3,
1,3,4,5,5,5,5,5,5,5,
1,3,5,6,7,7,7,7,7,7,
1,4,7,9,10,11,11,11,11,11,
1,4,8,11,13,14,15,15,15,15,
1,5,10,15,18,20,21,22,22,22,
1,5,12,18,23,26,28,29,30,30,
1,6,14,23,30,35,38,40,41,42};

  
	int T,M,N;
	cin>>T;
	while(T--)
	{
		cin>>M>>N;
		cout<<a[M-1][N-1]<<endl;

	
	}

	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