]]>re: POJ1002閾捐〃綆楁硶[鏈櫥褰昡http://www.shnenglu.com/issayandfaye/archive/2009/11/16/100347.html#101156dskitdskitMon, 16 Nov 2009 14:44:00 GMThttp://www.shnenglu.com/issayandfaye/archive/2009/11/16/100347.html#101156using std::cin;
using std::cout;
using std::endl;
#ifdef DEBUG
#include<string>
using std::string;
using std::freopen;
string input_file_name = __FILE__;
#endif
//here add other file need to included, and declare namespace need to use.
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
using namespace std;
//here declare global variables;
char dictionary[26] = {2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 0, 7, 7, 8, 8, 8, 9, 9, 9, 0};
char no[50];
char oarray[10];
bool flag;
struct Trie_node
{
int count;
Trie_node* next[10];
};
Trie_node root;
Trie_node node_pool[200002];
int index;
Trie_node* p;
int main(int argc, char* argv[])
{
#ifdef DEBUG
if(!freopen((input_file_name.substr(0, input_file_name.size() - 4) + ".in").c_str(), "r", stdin))
{ cout << "input data error, not found input file." << endl; return -1; }
#endif
//here add code for solve problem.
int n = 0;
//input
scanf("%d", &n);
flag = false;
index = 0;
getchar();
for(int i = 0; i < n; ++i)
{
gets(no);
//puts(no);
format_number(no);
insert(no);
}