字典树应用 poj 1002 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a mem
原创 2021-12-28 16:42:11
62阅读
从午后一点呼呼睡到三点,昏昏沉沉的,感觉学不了平衡树,于是找了道水题做做,不过这题
原创 2022-09-26 10:02:58
47阅读
#include <iostream>#include <string>#include <map>using namespace std;int main(){    int total;    char conver[9] = {'Q','R','S','T','U','V','W','X','Y'
原创 2008-04-10 22:14:15
2662阅读
1点赞
4评论
487-3279 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 191845   Accepted: 33280 Description Businesses like to have memorable telephone numbers. One way to m
原创 2023-08-21 16:49:37
77阅读
Businesses like to have memorable telephone numbers. One way to make a telephoneaterloo b
原创 2022-09-15 13:12:21
107阅读
codeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#include<iostream>2#include<map>3#include<string>4usingnamespacestd;56charmapch...
转载 2010-08-11 22:18:00
115阅读
2评论
 //poj 1002 //没有AC Time Limit Exceeded ,我用了链表,该用堆或二叉树的,有时间的时候在改下吧。先把我写的代码记在这里 #include <stdio.h> #include <string.h> #include <stdlib.h> #in
原创 2012-06-02 23:55:09
490阅读
//39556K 579MS G++#include #include using namespace std;char number[50];char AtoI[90];void init() { int beginVal = 2; int if (i != 'Q') {
原创 2023-05-23 15:54:48
30阅读
本文使用 Google Docs 编辑,以网页形式发布。最新版本请看以下链接: http://docs.google.com/View?id=df4r7psc_973ccmbxncn POJ Problem 1002 Solved!    这个题目的解题思路与上次写的英文单词自动补全、纠错很相似。先将电话号码用有根树的形式保存,每个节点表示一个号码,从根到叶节点就是一个完整的号码。
原创 2010-05-08 16:38:40
503阅读
#include <iostream>#include<string>#include<map>using namespace std;char mapping(char ch){ if(ch=='A'||ch=='B'||ch=='C')ch='2'; else if(ch=='D'||ch=='E'||ch=='F')ch='3'; else if(ch=='G'||ch=='H'||ch==
转载 2011-07-17 23:30:00
29阅读
487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 306973 Accepted: 54856 Description Businesses like to have memorable telephone num
转载 2018-06-17 10:09:00
366阅读
2评论
这个是超时版的:#include<iostream>#include<string>using namespace std;typedef struct TelephoneNumber{//表示电话号码的结构体string number;//电话号码串int prefix;//首数字int count;//重复次数}TelephoneNumber;/*#include<fstream>fstream fin ("input.txt",ios::in);#define cin fin//*/struct TelephoneNumber Tr
转载 2010-05-25 23:43:00
77阅读
2评论
题意:问一些7位数(可能有前导0,可到达100000个)是否有重复,将重复的按字典序从小到大输出并输出重复次数,没有的话输出“No duplicates.”。题目链接:http://poj.org/problem?id=1002——>>本来题目很水的,在刷后缀数组,中间有个基数排序的东西,于是用基数排序来做这题。。。#include #include #include using namespace std;const int maxn = 100000 + 10;int n, p[maxn][8], figure[maxn];int c[15], sa[maxn], fa[max
转载 2013-10-09 18:25:00
24阅读
2评论
ubmissions: 242236 Accepted: 42954DescriptionBusinesses like to have memorable telephone numbers. One way to make a...
原创 2023-07-19 16:02:07
44阅读
POJ-1002-(487-3279)
原创 2022-11-09 18:30:01
45阅读
题目链接:传送门 用map 因为里面的数字只有7位,所以可以开map< int,int>省去用< string,int>的写法 其中map
原创 2022-07-15 11:30:13
39阅读
传送门题目大意就是给你几种不同的表达形式的电话号码,然后需要你转化为直观的数字形式,
原创
VII
2023-05-26 14:52:16
43阅读
这题,对我锻炼意义挺大的。在知道多位乘法的算法的情况下,如何将其转换成代码还要
原创 2022-09-26 10:06:05
47阅读
这题就是字符串处理Program P1002;Type phone=record num,s:longint; end;var n,i,j,p:Longint; b:boolean; s:ansistring; a:array[0..9999999] of longint;// f:array[1..10000
原创 2012-08-07 17:13:59
117阅读
#include<stdio.h>#include<string>#include<map>#include<algorithm>#include<iostream>using namespace std;string s;string ss;map<char ,char>mc;map<string, int>ms;map<string, int>::iterator it;int main(){ mc['A']='2'; mc['P']='7
转载 2013-04-24 22:00:00
27阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5