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

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,但是效率極其低下,低下到讓人發指的程度,我也不知道為什么。估計是用了STL的原因,具體我也說不清楚。其實思路不難,就是將字符轉化成對應數字,然后將結果存放在一個整型向量中,接收字符串用的是字符串向量,處理的時候跟一般的字符串處理時一模一樣的。處理結束之后要進行字典排序,顯然要用排序函數,可以用冒泡,選擇,快排,甚至是Hash,但是據說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| 亚洲无限乱码一二三四麻| 午夜综合激情| 久久一区中文字幕| 欧美国产精品专区| 国产欧美日韩在线| 亚洲精品在线免费观看视频| 午夜在线精品偷拍| 亚洲欧美成人| 亚洲综合色在线| 国产精品日韩| 在线观看中文字幕亚洲| 国内精品模特av私拍在线观看| 欧美丰满高潮xxxx喷水动漫| 在线一区二区视频| 欧美一区二区三区精品电影| 欧美精品一区二区三区久久久竹菊| 欧美精品精品一区| 久久综合99re88久久爱| 亚洲黄页一区| 久久精品99国产精品日本| 欧美11—12娇小xxxx| 久久久久久高潮国产精品视| 一区二区三区精密机械公司 | 亚洲激情视频在线观看| 亚洲国产精品电影在线观看| 一区二区免费在线播放| 蜜臀va亚洲va欧美va天堂| 国产日韩欧美视频| 亚洲女ⅴideoshd黑人| 亚洲黑丝在线| 欧美精品一区二区在线观看| 亚洲国产一二三| 香蕉亚洲视频| 久久精品成人一区二区三区| 久久精品免视看| 欧美成人一二三| 亚洲午夜一区| 在线播放日韩欧美| 欧美视频三区在线播放| 欧美韩日一区二区三区| 亚洲精品一区二区三区蜜桃久| 国产亚洲精久久久久久| 欧美二区在线看| 欧美国产日韩二区| 午夜精品一区二区三区电影天堂| 欧美中文日韩| 国产一区二区三区四区在线观看| 久久国产精品色婷婷| 欧美在线观看日本一区| 亚洲国产精品福利| 一区二区精品在线观看| 亚洲剧情一区二区| 国产亚洲欧洲997久久综合| 国产欧美日本一区二区三区| 欧美午夜不卡视频| 欧美激情小视频| 欧美黄色片免费观看| 国产婷婷成人久久av免费高清 | 一本大道av伊人久久综合| 依依成人综合视频| 亚洲欧美第一页| 99国产成+人+综合+亚洲欧美| 国产精品国产三级国产专播精品人| 一区二区三区国产在线| 午夜一区二区三区在线观看| 在线视频观看日韩| 亚洲伦理在线| 亚洲成色999久久网站| 在线亚洲免费视频| 国产一区二区三区精品欧美日韩一区二区三区| 久久久久亚洲综合| 国产精品一卡| 中国成人黄色视屏| 在线亚洲伦理| 欧美连裤袜在线视频| 亚洲第一精品福利| 欧美国产极速在线| 一区一区视频| 久久精品视频一| 久久国产精品一区二区三区| 麻豆国产精品777777在线| 欧美成人精品福利| 亚洲电影在线| 久久在线视频在线| 欧美成人tv| 亚洲伊人网站| 国产日韩亚洲欧美| 另类亚洲自拍| 中文日韩电影网站| 久久综合伊人77777麻豆| 亚洲日本欧美在线| 欧美日韩一级片在线观看| 亚洲欧美日韩一区| 亚洲国产欧美一区二区三区久久| 日韩亚洲成人av在线| 国产一区二区激情| 欧美日韩国产电影| 久久免费一区| 香蕉久久夜色精品国产使用方法| 欧美搞黄网站| 久久亚洲视频| 亚洲综合大片69999| 亚洲娇小video精品| 韩国三级在线一区| 国产毛片一区二区| 欧美特黄一区| 欧美偷拍另类| 欧美日韩一区综合| 欧美日本亚洲| 欧美日韩你懂的| 欧美日韩国产精品| 欧美日韩精品系列| 国产精品二区在线| 国产精品久久久久国产精品日日| 欧美日韩岛国| 亚洲欧美伊人| 欧美一区成人| 久久青草福利网站| 久久精品一二三区| 欧美 日韩 国产 一区| 久久精品人人| 欧美一区二区三区免费观看| 亚洲尤物在线视频观看| 亚洲欧洲99久久| 久久精品综合| 欧美黑人在线播放| 亚洲黄色小视频| 亚洲永久免费| 美女主播精品视频一二三四| 欧美综合国产| 久久精品视频免费| 午夜日韩在线观看| 欧美电影免费观看大全| 国产精品―色哟哟| 在线看片一区| 久久成人综合视频| 一本久久a久久精品亚洲| 久久精品国产精品亚洲| 欧美日韩免费观看一区二区三区 | 亚洲一区二区不卡免费| 欧美一区二区观看视频| 欧美精品乱码久久久久久按摩| 国产综合香蕉五月婷在线| 亚洲一区二区在线视频| 欧美激情在线有限公司| 久久―日本道色综合久久| 国产精品国产三级国产专区53| 亚洲国产精品日韩| 亚洲国产成人在线视频| 久久视频一区| 亚洲国产精品尤物yw在线观看| 欧美主播一区二区三区美女 久久精品人 | 亚洲午夜电影| 欧美全黄视频| 亚洲一二三区精品| 亚洲免费精彩视频| 欧美片在线播放| 亚洲一区在线视频| 亚洲视频精选| 国产一区二区av| 欧美伊久线香蕉线新在线| 亚洲国产精品成人va在线观看| 国产亚洲a∨片在线观看| 性做久久久久久| 翔田千里一区二区| 国产精品永久| 欧美不卡三区| 欧美日韩福利视频| 欧美伊久线香蕉线新在线| 91久久精品www人人做人人爽| 亚洲三级网站| 国产欧美一区二区精品仙草咪 | 亚洲国产日韩欧美| 日韩视频免费观看高清完整版| 国产欧美日韩麻豆91| 免费视频一区| 国产精品成人aaaaa网站| 欧美xart系列高清| 国产精品麻豆欧美日韩ww| 免费观看久久久4p| 国产精品黄色| 日韩一级精品视频在线观看| 欧美日韩国产综合视频在线观看| 午夜精品成人在线| 午夜精品久久久久99热蜜桃导演| 久久久综合免费视频| 国产欧美日韩亚洲| 久久综合中文字幕| 午夜日韩福利| 久久久久久久综合| 久久亚洲图片| 国产一区二区日韩精品欧美精品| 亚洲男人的天堂在线观看| 欧美日韩国产美| 亚洲日本一区二区| 一区二区三区回区在观看免费视频| 久久久噜噜噜久久狠狠50岁| 老色批av在线精品|