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

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>
            在线观看不卡| 国产精品夜夜夜一区二区三区尤| 欧美一区激情视频在线观看| 国产精品草莓在线免费观看| 亚洲欧美日韩一区二区三区在线| 91久久国产综合久久| 蜜臀久久99精品久久久久久9 | 欧美性片在线观看| 性色av一区二区三区在线观看| 久久精品盗摄| 亚洲视频精选| 久久视频在线免费观看| 日韩视频永久免费| 久久精品二区| 午夜精品福利视频| 欧美激情一区在线| 久久久一本精品99久久精品66| 久久久之久亚州精品露出| 亚洲视频视频在线| 欧美国产成人在线| 老司机一区二区三区| 国产精品系列在线播放| 91久久综合| 亚洲国产精品99久久久久久久久| 亚洲欧美一区二区激情| 制服诱惑一区二区| 欧美成人精品高清在线播放| 久久不射网站| 国语自产在线不卡| 欧美在线一区二区三区| 久久成人精品| 国内精品免费午夜毛片| 欧美在线观看视频一区二区三区 | 亚洲第一在线综合网站| 国内自拍亚洲| 美女尤物久久精品| 亚洲国产精品精华液2区45| 日韩视频免费在线| 欧美日韩你懂的| 亚洲欧美日韩精品久久| 久久精品最新地址| 91久久国产综合久久蜜月精品 | 免费精品99久久国产综合精品| 麻豆91精品91久久久的内涵| 在线高清一区| 国产精品videossex久久发布| 中国av一区| 牛牛精品成人免费视频| 亚洲无线观看| 一区二区在线视频| 欧美日韩精品免费 | 极品少妇一区二区三区精品视频 | 国产精品夜夜夜| 欧美成人资源| 欧美专区18| 午夜视频在线观看一区| 91久久综合| 欧美激情国产精品| 久久久精品五月天| 亚洲中字在线| 亚洲视频免费在线观看| 国产日韩精品视频一区| 欧美午夜精品久久久久久人妖 | 亚洲欧美国产精品va在线观看| 国产精品萝li| 欧美日韩一卡| 欧美久久九九| 欧美日韩精品三区| 免费h精品视频在线播放| 欧美一区二区三区在线观看 | 国产精品男女猛烈高潮激情| 欧美高清在线视频| 欧美精品久久一区| 欧美精品亚洲精品| 欧美日韩精品免费看 | 亚洲视频999| 亚洲欧美日韩精品久久亚洲区| 亚洲素人在线| 亚洲欧美99| 久久天天躁狠狠躁夜夜av| 久久亚洲综合| 亚洲国产另类精品专区| 亚洲美女在线观看| 久久精品99国产精品日本| 久久久久一区二区三区四区| 欧美高清视频在线观看| 国产精品草莓在线免费观看| 国内外成人免费激情在线视频网站| 国产欧美成人| 一区二区三区精品视频在线观看| 亚洲视频播放| 亚洲国产毛片完整版| 亚洲女性喷水在线观看一区| 免费看亚洲片| 好看的亚洲午夜视频在线| 中文久久乱码一区二区| 噜噜噜久久亚洲精品国产品小说| 亚洲黄色影院| 麻豆9191精品国产| 国产一区二区三区在线观看精品 | 国产精品视频一区二区三区| 最新日韩在线视频| 另类图片国产| 久久成人人人人精品欧| 国产精品久久久久国产a级| 日韩一级在线| 亚洲国产aⅴ天堂久久| 久久久久久久精| 一色屋精品视频免费看| 久久综合九色综合欧美就去吻| 午夜精品一区二区在线观看| 国产女人18毛片水18精品| 亚洲男人的天堂在线aⅴ视频| 日韩视频专区| 欧美午夜视频网站| 欧美在线观看日本一区| 亚洲欧美日本国产有色| 国内精品久久久| 欧美成人精品不卡视频在线观看 | 亚洲精品视频在线观看网站| 欧美大片专区| 欧美一区二区三区免费视频| 午夜精品久久久久影视| 在线观看成人网| 日韩小视频在线观看专区| 国产日韩精品在线播放| 欧美xx69| 国产精品久久午夜夜伦鲁鲁| 久久婷婷国产麻豆91天堂| 美女91精品| 久久se精品一区精品二区| 欧美高清视频在线| 欧美在线视频全部完| 欧美国产综合| 男女视频一区二区| 国产精品美女久久久久aⅴ国产馆| 久久久久国产成人精品亚洲午夜| 欧美日韩爆操| 欧美美女日韩| 久久精品国产亚洲一区二区三区| 久久综合伊人77777麻豆| 久久国产毛片| 国产麻豆91精品| 一区二区精品在线| 一区二区三区欧美| 欧美精品黄色| 一区二区三区视频在线看| 亚洲毛片在线免费观看| 老巨人导航500精品| 快播亚洲色图| 亚洲片国产一区一级在线观看| 久久精品理论片| 欧美高清你懂得| 亚洲精品乱码久久久久| 欧美精品aa| 亚洲午夜伦理| 欧美一区二区视频免费观看| 国产农村妇女毛片精品久久莱园子 | 99re亚洲国产精品| 亚洲一区久久久| 国产视频在线观看一区| 久久免费偷拍视频| 亚洲日本成人女熟在线观看| 亚洲视频香蕉人妖| 国产乱码精品1区2区3区| 久久精品国产综合精品| 亚洲国产精品综合| 久久精品国产精品亚洲| 亚洲国产一区在线观看| 国产精品日韩精品欧美精品| 久久九九国产| 亚洲婷婷在线| 亚洲精品久久久久久久久久久久久| 亚洲一区国产| 亚洲精品一区二区三区蜜桃久| 国产乱码精品一区二区三| 免费观看日韩av| 欧美在线视频一区| 亚洲一级免费视频| 日韩视频在线观看一区二区| 欧美激情在线狂野欧美精品| 久久精品免费| 久久不射中文字幕| 亚洲砖区区免费| 午夜精品亚洲一区二区三区嫩草| 亚洲精品国偷自产在线99热| 有码中文亚洲精品| 黄色亚洲大片免费在线观看| 国产午夜精品理论片a级大结局| 国产精品多人| 国产精品人成在线观看免费 | 国产精品免费一区二区三区在线观看 | 午夜精品久久久久久久99水蜜桃| 99精品欧美一区| 99国产精品国产精品久久| 亚洲精品在线一区二区| 亚洲精品日日夜夜| 亚洲综合视频网| 久久久久国产一区二区| 欧美大尺度在线|