青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Brian Warehouse

Some birds aren`t meant to be caged, their feathers are just too bright... ...
posts - 40, comments - 16, trackbacks - 0, articles - 1

POJ 1002 487-3279

Posted on 2010-08-17 14:04 Brian 閱讀(264) 評論(0)  編輯 收藏 引用 所屬分類: POJ

事先申明,該程序雖然AC,但是效率極其低下,低下到讓人發(fā)指的程度,我也不知道為什么。估計是用了STL的原因,具體我也說不清楚。其實思路不難,就是將字符轉(zhuǎn)化成對應(yīng)數(shù)字,然后將結(jié)果存放在一個整型向量中,接收字符串用的是字符串向量,處理的時候跟一般的字符串處理時一模一樣的。處理結(jié)束之后要進行字典排序,顯然要用排序函數(shù),可以用冒泡,選擇,快排,甚至是Hash,但是據(jù)說STL的sort 效率比快排還要快。源程序后附加了MSDN上的一些簡單解釋。沒有翻譯!

Description

Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of Waterloo by dialing the memorable TUT-GLOP. Sometimes only part of the number is used to spell a word. When you get back to your hotel tonight you can order a pizza from Gino's by dialing 310-GINO. Another way to make a telephone number memorable is to group the digits in a memorable way. You could order your pizza from Pizza Hut by calling their ``three tens'' number 3-10-10-10.

The standard form of a telephone number is seven decimal digits with a hyphen between the third and fourth digits (e.g. 888-1200). The keypad of a phone supplies the mapping of letters to numbers, as follows:

A, B, and C map to 2
D, E, and F map to 3
G, H, and I map to 4
J, K, and L map to 5
M, N, and O map to 6
P, R, and S map to 7
T, U, and V map to 8
W, X, and Y map to 9

There is no mapping for Q or Z. Hyphens are not dialed, and can be added and removed as necessary. The standard form of TUT-GLOP is 888-4567, the standard form of 310-GINO is 310-4466, and the standard form of 3-10-10-10 is 310-1010.

Two telephone numbers are equivalent if they have the same standard form. (They dial the same number.)

Your company is compiling a directory of telephone numbers from local businesses. As part of the quality control process you want to check that no two (or more) businesses in the directory have the same telephone number.

Input

The input will consist of one case. The first line of the input specifies the number of telephone numbers in the directory (up to 100,000) as a positive integer alone on the line. The remaining lines list the telephone numbers in the directory, with each number alone on a line. Each telephone number consists of a string composed of decimal digits, uppercase letters (excluding Q and Z) and hyphens. Exactly seven of the characters in the string will be digits or letters.

Output

Generate a line of output for each telephone number that appears more than once in any form. The line should give the telephone number in standard form, followed by a space, followed by the number of times the telephone number appears in the directory. Arrange the output lines by telephone number in ascending lexicographical order. If there are no duplicates in the input print the line:
No duplicates.

C++ 編譯器:

#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // STL sort function
using namespace std;

char map[] = "2223334445556667#77888999#";
                  //ABCDEFGHIJKLMNOPQRSTUVWXYZ
void visited(char &ch) // visit and format strings
{
   if (ch >= 'A' && ch <= 'Z')
    ch=map[ch-'A']; // ch equals to its real number
}

int main()
{
    int N,i=0,j,flag=0;
 string s;
 vector<string> stored(100000); // be visited & stored (up to 100,000)
    cin>>N;
 vector<int> counter(N,1); // stored times
   
 for (; i<N; i++)
 {
  cin>>s;
  for (j=0; j<s.length(); j++) // MSDN
  {
   visited(s[j]);
   if (s[j]!='-')
   {
    stored[i] += s[j];
    if (stored[i].length()==3)
     stored[i] += '-'; // 487 -[3] 3279
   }
  }
 }
    sort(stored.begin(),stored.begin()+N); // Quicker than QuickSort!
 // should not used stored.end() !
 i=0; j=1;
    while (i<N)
 {
  while(stored[i] == stored[j])
  {
   counter[i]++;
   j++;
   flag=1;
  }
  i=j;
  j++;
 }
 
    if (flag)
  for (i=0; i<N; i++)
  {
   if (counter[i]>1)
    cout<<stored[i]<<" "<<counter[i]<<endl;
  } // must have { }
 else cout<<"No duplicates."<<endl;
  
 return 0;
}

Sort :
Arranges the elements in a specified range into a nondescending order or according to an ordering criterion specified by a binary predicate.

 
template<class RandomAccessIterator>
   void sort(
      RandomAccessIterator _First,
      RandomAccessIterator _Last
   );

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲乱码精品一二三四区日韩在线 | 亚洲大胆美女视频| 欧美一级网站| 久久青草欧美一区二区三区| 久久天天躁狠狠躁夜夜av| 狂野欧美激情性xxxx欧美| 美女91精品| 亚洲欧洲精品一区二区| 中日韩美女免费视频网址在线观看| 一区二区三区成人精品| 欧美一级专区免费大片| 猛男gaygay欧美视频| 欧美日韩国产影院| 国模吧视频一区| 日韩视频二区| 欧美在线观看一二区| 欧美韩国一区| 亚洲中午字幕| 久久综合九九| 国产精品一区二区男女羞羞无遮挡| 影音先锋日韩资源| 亚洲一区二区视频在线| 久久久久一区二区三区四区| 亚洲日本va在线观看| 欧美一区二区三区播放老司机| 欧美1级日本1级| 国产日韩欧美不卡| 夜夜精品视频| 免费观看欧美在线视频的网站| 亚洲精品欧美| 久久亚洲精品一区| 国产欧美日韩免费看aⅴ视频| 亚洲人成绝费网站色www| 欧美亚洲专区| 日韩一区二区免费看| 麻豆freexxxx性91精品| 国产欧美日韩三区| 国产精品99久久久久久久久久久久 | 欧美在线观看一区| 久久综合久久久久88| 国产精品网红福利| 在线播放亚洲一区| 欧美中文在线视频| 亚洲精品在线观| 久久精品国产第一区二区三区| 欧美国产日韩a欧美在线观看| 国产午夜精品在线观看| 亚洲欧美日韩精品久久亚洲区| 亚洲激情国产精品| 麻豆av一区二区三区久久| 国内精品久久久久影院优| 先锋影音久久| 在线亚洲+欧美+日本专区| 欧美日本免费| 一区二区三区高清| 亚洲日本中文| 欧美日韩国产首页| 亚洲天堂激情| 99精品久久| 欧美色精品天天在线观看视频 | 日韩网站在线观看| 亚洲国产三级网| 欧美激情91| 亚洲一二三区在线观看| 夜夜嗨一区二区三区| 国产精品vip| 欧美一区二区三区免费观看视频 | 国产精品一区二区你懂的| 午夜精品网站| 午夜激情一区| 在线观看日韩国产| 亚洲电影第1页| 欧美剧在线观看| 亚洲欧美韩国| 久久大逼视频| 日韩一级大片| 亚洲天堂第二页| 国产在线视频欧美一区二区三区| 久久国产日韩欧美| 久久久久久久久久久久久女国产乱 | 亚洲视频在线看| 国产亚洲毛片| 欧美成人综合| 国产精品女主播在线观看| 久久久精品日韩| 欧美福利视频| 欧美一区二区三区在线观看| 国产精品美女在线观看| 伊人久久婷婷色综合98网| 欧美成va人片在线观看| 欧美日韩性生活视频| 午夜宅男久久久| 男人天堂欧美日韩| 亚洲欧美日韩视频二区| 久久另类ts人妖一区二区| 99re热这里只有精品视频| 午夜精品视频在线| 亚洲另类在线视频| 欧美一区二区精品久久911| 日韩图片一区| 久久精品99国产精品酒店日本| 亚洲国产裸拍裸体视频在线观看乱了中文 | 国语自产精品视频在线看抢先版结局| 欧美大学生性色视频| 国产精品国产| 亚洲大黄网站| 国产一区 二区 三区一级| 亚洲精品日韩在线观看| 影院欧美亚洲| 亚洲一区精彩视频| av不卡在线看| 免费不卡在线视频| 久久性天堂网| 国产嫩草影院久久久久| 亚洲精品美女91| 亚洲国产欧美一区二区三区久久| 亚洲欧美日韩在线| 亚洲一区二区三区色| 欧美黄色aaaa| 欧美国产日本高清在线| 精品二区视频| 久久爱www.| 久久av二区| 国产欧美精品一区二区三区介绍| 夜夜嗨av一区二区三区中文字幕 | 欧美资源在线| 国产精品人成在线观看免费 | 狂野欧美激情性xxxx| 久久一二三区| 国产一区二区高清不卡| 亚洲一线二线三线久久久| 亚洲在线观看视频网站| 欧美日韩综合另类| 中文国产成人精品久久一| 亚洲婷婷在线| 国产精品第2页| 亚洲专区国产精品| 久久国产欧美日韩精品| 国内精品视频一区| 久久久五月婷婷| 亚洲大片免费看| 欧美成人自拍| 久久青草久久| 欧美成人午夜免费视在线看片| 国产主播一区二区三区| 性欧美激情精品| 久久综合久久美利坚合众国| 激情综合久久| 美女网站久久| 日韩亚洲欧美一区二区三区| 亚洲夜间福利| 国产精品色一区二区三区| 欧美亚洲日本网站| 欧美成人精品激情在线观看| 亚洲乱码国产乱码精品精| 欧美精品一区二区蜜臀亚洲| 一区二区三区偷拍| 久久人人九九| 99国内精品| 国产性做久久久久久| 久久久国产午夜精品| 亚洲黑丝在线| 销魂美女一区二区三区视频在线| 国产亚洲一区在线播放| 欧美成人激情视频| 亚洲专区欧美专区| 欧美电影免费观看高清| 亚洲午夜91| 在线观看成人小视频| 欧美网站在线观看| 久久精品青青大伊人av| 亚洲精品乱码视频| 久久一区二区三区av| 亚洲天堂av在线免费| 黄色日韩网站| 欧美天堂亚洲电影院在线播放| 欧美在线视频网站| 艳女tv在线观看国产一区| 久久亚洲视频| 午夜精品福利电影| 日韩午夜在线| 伊人色综合久久天天| 欧美日韩在线亚洲一区蜜芽 | 亚洲在线不卡| 亚洲区国产区| 蜜臀a∨国产成人精品| 羞羞视频在线观看欧美| 亚洲精品一线二线三线无人区| 国产欧美日韩三区| 国产精品扒开腿做爽爽爽软件| 美女被久久久| 久久精品99国产精品酒店日本| 亚洲视频导航| 99re8这里有精品热视频免费| 欧美国产精品久久| 看欧美日韩国产| 久久久久九九九| 欧美在线啊v| 欧美亚洲在线视频| 亚洲免费在线视频|