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 |
数据量太小直接打表过。。帖代码参考#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator