我寫的搜索程序太慢了……沒敢提交上去……寫了個交表的程序。猥瑣地飄過……
以下是我的代碼:
#include<iostream>
using namespace std;
const long cheat[9][67]={{0},
{1,1},
{1,4,4},
{1,9,26,26,8},
{1,16,92,232,260,112,16},
{1,25,240,1124,2728,3368,1960,440,32},
{1,36,520,3896,16428,39680,53744,38368,12944,1600,64},
{1,49,994,10894,70792,282248,692320,1022320,867328,389312,81184,5792,128},
{1,64,1736,26192,242856,1444928,5599888,14082528,22522960,22057472,12448832,3672448,489536,20224,256}};
int main()
{
long n,k;
while(cin>>n>>k)
{
if(n==0&&k==0) break;
cout<<cheat[n][k]<<endl;
}
return 0;
}
posted on 2010-11-12 22:04
lee1r 閱讀(766)
評論(1) 編輯 收藏 引用 所屬分類:
題目分類:搜索