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

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>
            99国内精品久久| 一本综合精品| 美女视频黄 久久| 亚洲成色777777女色窝| 免费人成精品欧美精品| 嫩草伊人久久精品少妇av杨幂| 亚洲国产欧美久久| 99热精品在线| 韩国欧美一区| 亚洲精品视频在线播放| 国产欧美不卡| 亚洲第一区在线| 欧美日韩在线免费观看| 久久久精品免费视频| 欧美福利视频一区| 性亚洲最疯狂xxxx高清| 久久一区二区三区超碰国产精品| 亚洲精品网址在线观看| 亚洲男人的天堂在线观看| 一色屋精品亚洲香蕉网站| 91久久精品久久国产性色也91| 欧美午夜国产| 欧美高清视频| 国产精品手机在线| 亚洲国产高清aⅴ视频| 国产乱码精品一区二区三区不卡| 免费中文日韩| 国产日韩精品一区二区三区| 亚洲高清中文字幕| 国产精品综合久久久| 亚洲高清久久网| 国产一区久久久| 日韩亚洲视频| 亚洲欧洲在线一区| 久久se精品一区精品二区| 一区二区三区视频免费在线观看| 欧美中文字幕在线播放| 亚洲自拍电影| 欧美日韩1080p| 欧美激情亚洲自拍| 狠狠色综合一区二区| 亚洲欧美精品在线| 欧美亚洲视频| 国产精品久在线观看| 亚洲另类黄色| 亚洲蜜桃精久久久久久久| 久久综合伊人| 欧美mv日韩mv国产网站app| 国产欧美日韩综合精品二区| 亚洲一区久久久| 亚洲午夜精品视频| 欧美日韩裸体免费视频| 亚洲人在线视频| 亚洲精品国产日韩| 免费观看成人网| 欧美高清在线精品一区| 亚洲国产成人久久| 久久在线免费| 欧美 亚欧 日韩视频在线| 国产综合视频| 久久精品亚洲热| 蜜臀99久久精品久久久久久软件| 狠狠色综合日日| 久久久蜜臀国产一区二区| 麻豆久久婷婷| 亚洲大片免费看| 欧美成年视频| 日韩午夜高潮| 欧美一区二区精品久久911| 国产精品免费电影| 欧美一级理论片| 欧美 日韩 国产 一区| 亚洲三级视频| 欧美午夜精品一区二区三区| 亚洲影院在线| 久久一区欧美| 91久久亚洲| 欧美日韩视频不卡| 午夜在线一区二区| 欧美mv日韩mv国产网站| 日韩一级黄色片| 国产精品美腿一区在线看| 久久国产手机看片| 亚洲国产精品成人一区二区 | 国产一区日韩二区欧美三区| 欧美一区二区三区免费在线看| 久久久久久久一区二区三区| 91久久久亚洲精品| 国产精品成人国产乱一区| 性欧美精品高清| 亚洲精品九九| 久久精品91久久香蕉加勒比 | 国产欧美一区二区三区另类精品 | 亚洲欧美bt| 亚洲大胆人体视频| 亚洲欧美国产另类| 在线观看中文字幕不卡| 欧美日韩在线直播| 久久久久欧美| 亚洲一区二区3| 亚洲国产成人精品久久| 欧美一区二区网站| 99在线精品视频在线观看| 国产色产综合产在线视频| 欧美精品xxxxbbbb| 久久精品99久久香蕉国产色戒| 亚洲精品在线看| 女人色偷偷aa久久天堂| 欧美中文在线观看| 一区二区欧美日韩| 亚洲黄网站在线观看| 国产日韩精品视频一区| 欧美视频在线观看免费| 欧美电影免费观看大全| 久久久精彩视频| 亚洲欧美日韩国产精品| 日韩一区二区免费高清| 亚洲国产精品国自产拍av秋霞| 久久久久久久网站| 久久国内精品视频| 香蕉av777xxx色综合一区| 一区二区三区**美女毛片| 91久久线看在观草草青青| 精品成人在线观看| 国产欧美一区二区在线观看| 国产精品国产三级国产aⅴ浪潮| 欧美风情在线观看| 麻豆精品视频在线| 久久综合色综合88| 麻豆91精品| 免费成人激情视频| 麻豆精品视频在线| 美女主播一区| 欧美波霸影院| 欧美激情1区2区| 欧美激情精品久久久久久大尺度| 久久综合久色欧美综合狠狠 | 欧美午夜精品久久久久久孕妇| 欧美成人综合一区| 欧美成年人网站| 欧美国内亚洲| 欧美日韩亚洲一区三区| 欧美日韩黄视频| 国产精品福利网站| 国产女人精品视频| 国产一区二区三区在线观看视频 | 一本色道久久综合亚洲91| 亚洲欧洲一级| 一本大道久久精品懂色aⅴ| 日韩视频在线一区二区| 一区二区三区视频在线| 亚洲免费在线| 久久久国产午夜精品| 蜜桃久久精品乱码一区二区| 亚洲国产精品123| 99re这里只有精品6| 亚洲综合电影| 久久久久九九九| 欧美片在线播放| 国产日韩精品在线| 亚洲日本黄色| 亚洲欧美电影院| 久久这里只有| 亚洲美女在线观看| 午夜精品视频在线| 欧美成人高清视频| 国产精品免费网站| 亚洲国产精品成人久久综合一区| 日韩一区二区免费看| 欧美在线观看日本一区| 欧美激情第9页| 中文精品视频| 免费一级欧美片在线观看| 欧美日韩一区二区欧美激情| 激情成人亚洲| 亚洲欧美综合一区| 欧美成人性生活| 亚洲综合色在线| 欧美aaa级| 国产综合欧美| 亚洲欧美日韩在线一区| 欧美成人tv| 亚洲欧美视频在线观看| 欧美精品久久一区二区| 国内精品久久久久久| 亚洲一区二区三区777| 噜噜噜噜噜久久久久久91| 在线视频一区二区| 猛男gaygay欧美视频| 国产亚洲电影| 亚洲天堂免费在线观看视频| 欧美a级一区二区| 先锋影音国产一区| 国产精品国产自产拍高清av| 91久久精品国产91久久| 麻豆精品一区二区av白丝在线| 亚洲免费视频网站| 欧美午夜精品久久久久久浪潮| 亚洲精品日韩在线观看| 欧美成人激情在线|