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

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>
            久久免费视频在线观看| 亚洲精品乱码久久久久久黑人 | 欧美aaa级| 国产精品福利在线| 99re在线精品| 欧美电影免费观看高清完整版 | 亚洲电影免费观看高清| 亚洲永久免费观看| 亚洲精品影院| 欧美三日本三级少妇三2023| 最新高清无码专区| 亚洲国产一区视频| 欧美精品在线播放| 在线亚洲国产精品网站| 一本色道久久99精品综合| 欧美日韩在线播放一区二区| 亚洲综合精品一区二区| 在线午夜精品| 国产一区二区三区在线观看精品| 久久久久久久久久看片| 猫咪成人在线观看| 一区二区欧美在线| 亚洲欧美大片| 揄拍成人国产精品视频| 亚洲国产另类久久久精品极度| 欧美精品aa| 亚洲永久字幕| 欧美制服丝袜第一页| 亚洲黄色高清| 亚洲图片欧洲图片av| 国产精品普通话对白| 久久久999| 欧美精品在线视频观看| 欧美综合77777色婷婷| 久久久亚洲欧洲日产国码αv | 国产精品高精视频免费| 久久中文久久字幕| 欧美激情在线观看| 亚洲看片免费| 亚洲字幕一区二区| 国产欧美综合一区二区三区| 欧美大片免费观看在线观看网站推荐 | 伊人色综合久久天天五月婷| 亚洲免费高清| 国产精品系列在线播放| 欧美电影在线观看| 欧美日韩国产区一| 久久久人成影片一区二区三区| 欧美激情1区2区3区| 亚洲一级网站| 美脚丝袜一区二区三区在线观看| 一二三四社区欧美黄| 欧美有码在线观看视频| 在线综合亚洲| 欧美大片一区| 亚洲欧美成人综合| 欧美福利视频| 香蕉久久久久久久av网站| 女女同性女同一区二区三区91| 亚洲在线视频观看| 欧美一区二区三区在线免费观看| 在线免费观看日本欧美| 欧美亚洲午夜视频在线观看| 亚洲小说区图片区| 欧美精品粉嫩高潮一区二区| 久久精品视频在线播放| 欧美日韩成人综合在线一区二区| 亚洲一区精彩视频| 欧美日韩精品| 亚洲日本在线观看| 亚洲毛片在线观看| 免费成人小视频| 小嫩嫩精品导航| 国产精品免费一区二区三区在线观看 | 亚洲欧美成人一区二区在线电影| 一区二区三区国产| 欧美日韩国产999| 最新热久久免费视频| 亚洲欧洲精品一区二区精品久久久 | 在线一区二区视频| 欧美日本国产| 9人人澡人人爽人人精品| 亚洲图片在线观看| 欧美小视频在线| 亚洲无毛电影| 欧美在线免费视频| 国产精品蜜臀在线观看| 亚洲精品影视在线观看| 国产精品99久久99久久久二8| 欧美精品123区| 99热这里只有精品8| 亚洲欧美日韩精品一区二区| 国产精品久久久久久久一区探花 | 另类尿喷潮videofree| 亚洲国产高清在线| 欧美成人精品一区二区三区| 91久久精品一区| 亚洲一区二区三区高清| 国产精品一区视频| 久久国产加勒比精品无码| 欧美ed2k| 亚洲视频一区二区在线观看 | 亚洲一级二级在线| 久久久五月天| 亚洲精品男同| 国产精品久久看| 久久九九国产| 亚洲美女在线看| 久久久精品欧美丰满| 亚洲国语精品自产拍在线观看| 欧美欧美午夜aⅴ在线观看| 亚洲视频一区二区| 久久综合色婷婷| 一区二区电影免费观看| 国产麻豆成人精品| 欧美成人xxx| 在线视频一区观看| 欧美国产亚洲精品久久久8v| 亚洲中无吗在线| 亚洲第一久久影院| 国产乱码精品| 欧美区国产区| 久久九九国产精品| 亚洲社区在线观看| 亚洲激情成人在线| 久久午夜精品一区二区| 中日韩高清电影网| 最新国产精品拍自在线播放| 国产精品私拍pans大尺度在线| 久久综合狠狠综合久久综青草| 免费试看一区| 亚洲一本大道在线| 狠狠色丁香久久综合频道| 欧美xxxx在线观看| 久久久久久久综合色一本| 亚洲婷婷综合久久一本伊一区| 欧美黑人一区二区三区| 久久一二三四| 久久久久国产精品午夜一区| 亚洲欧美在线免费观看| 中文欧美日韩| 99re热这里只有精品视频| 亚洲国产成人av好男人在线观看| 国产精品免费看| 国产精品av久久久久久麻豆网| 欧美成人69av| 欧美高清自拍一区| 久久永久免费| 久久一二三区| 久久嫩草精品久久久精品一 | 久久免费国产精品1| 香港成人在线视频| 亚洲欧美一区二区三区在线| 亚洲一区二区在线看| 一区二区三区国产| 中文无字幕一区二区三区| 在线视频精品一区| 一区二区三区免费在线观看| 一区二区三区黄色| 一道本一区二区| 亚洲第一色中文字幕| 国内精品嫩模av私拍在线观看| 国产欧美日韩一区| 国产日产欧产精品推荐色 | 亚洲电影免费观看高清完整版在线观看 | 亚洲亚洲精品三区日韩精品在线视频| 激情综合在线| 亚洲激情啪啪| 一区二区欧美在线| 亚洲专区欧美专区| 久久激情视频免费观看| 久久伊人精品天天| 欧美激情亚洲综合一区| 亚洲日本一区二区| 一本大道久久a久久精品综合| 亚洲视频一区在线| 欧美专区一区二区三区| 久热爱精品视频线路一| 欧美日本免费| 国产欧美日韩麻豆91| 激情婷婷久久| 妖精视频成人观看www| 亚洲欧美另类国产| 亚洲免费在线精品一区| 免费国产一区二区| 欧美日韩另类在线| 伊人激情综合| 午夜精品影院在线观看| 亚洲国产婷婷| 久久国产欧美日韩精品| 欧美日韩在线视频观看| 亚洲国内在线| 久久久最新网址| 亚洲一区美女视频在线观看免费| 久久综合中文字幕| 狠狠爱综合网| 久久国产精品久久精品国产| 亚洲日本欧美在线| 欧美成人精品一区二区三区| 韩国一区二区三区美女美女秀|