记录编号 173091 评测结果 AAAAAAAAAA
题目名称 [NOIP 2008]笨小猴 最终得分 100
用户昵称 Gravatar啊吧啦吧啦吧 是否通过 通过
代码语言 C++ 运行时间 0.003 s
提交时间 2015-07-27 21:31:40 内存使用 0.31 MiB
显示代码纯文本
#include <iostream>
#include <string>
#include <fstream>

using namespace std;

bool b[101]={0,
	0,1,1,0,1,0,1,0,0,0,
	1,0,1,0,0,0,1,0,1,0,
	0,0,1,0,0,0,0,0,1,0,
	1,0,0,0,0,0,1,0,0,0,
	1,0,1,0,0,0,1,0,0,0,
	0,0,1,0,0,0,0,0,1,0,
	1,0,0,0,0,0,1,0,0,0,
	1,0,1,0,0,0,0,0,1,0,
	0,0,1,0,0,0,0,0,1,0,
	0,0,0,0,0,0,1,0,0,0};
string s;
int t[26], maxx = -1, minn = 200;

main()
{
	ifstream fin("word.in");
	ofstream fout("word.out");
#define cin fin
#define cout fout
	ios::sync_with_stdio(false);
	cin >> s;
	
	for (int i = 0; i < s.size(); ++i)
		t[s[i] - 'a']++;
	for (int i = 0; i < 26; ++i){
		maxx = max(maxx, t[i]);
		if(t[i] > 0)
			minn = min(minn, t[i]);
	}
	
	if(b[maxx - minn])
		cout << "Lucky Word\n" << maxx - minn;
	else
		cout << "No Answer\n" << 0;
}