| 记录编号 | 
        435164 | 
        评测结果 | 
        AAAAAAAAAA | 
    
    
        | 题目名称 | 
        87.[NOIP 2000J/S]乘积最大 | 
        最终得分 | 
        100 | 
            
    
    
        | 用户昵称 | 
         @@@ | 
        是否通过 | 
        通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        0.000 s  | 
    
    
        | 提交时间 | 
        2017-08-09 10:04:49 | 
        内存使用 | 
        0.33 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include <fstream>
#include "string"
#include "vector"
#ifndef LL
#define LL long long
#endif
using namespace std;
ifstream cin("cjzd.in");
ofstream cout("cjzd.out");
LL s[45][45],n,k,ans;
string jj;
// 1231
LL w = 0;
LL dfs(LL x,LL y)
{
	w++;
	
	if(x == 1 && w == k+1)
	{
		return s[x][y];
	}
	if(w == k+1)
	{
		return 1;
	}
	LL  m = 0;
	for(LL i = x-1;i >= 1&&w <= k;i--)
	{
		LL f = s[x][y]*dfs(i,x-1);
		if(f > m)
			m = f;
		w--;
	} 
	return m;
}
LL cyf()
{	
	cin >> n >> k >> jj;
	for (LL i = 1; i <= n; ++i)
	{
		for (LL j = i; j <= n; ++j)
		{
			s[i][j] = s[i][j-1]*10+jj[j-1]-'0';
			/* code */
		}
		/* code */
	}
	for(LL i = n;i >= 1;i--)
	{
		//ans = max(dfs(i,n),ans);
		w = 0;
		LL f = dfs(i,n);
		if(ans<f)
			ans = f;
	}
	cout << ans << endl;
	cin.close();				
	cout.close();
	return 0;
}
int hhhh = cyf();
int main() {;}