UVA 755 487-3279
来源:互联网 发布:美空网怎么约 知乎 编辑:程序博客网 时间:2024/05/29 21:32
这写的跑得真慢,不过还是过了。。
#include <iostream>#include <sstream>#include <cstdio>#include <cstring>#include <cmath>#include <string>#include <vector>#include <set>#include <cctype>#include <algorithm>#include <cmath>#include <deque>#include <map>using namespace std;///#define INF 0xffffff7#define MAXN 200 ///int nCases;char num[] = "22233344455566677778889999";map<string, int> tel;int main(){///int i, j;cin >> nCases;while (nCases--){tel.clear();int nums;cin >> nums;for (i = 0; i < nums; i++){string temp, trans;cin >> temp;trans = "";int k = 0;for (j = 0; j < temp.size(); j++){if (k == 3){trans += '-';k++;j--;continue;}if (isupper(temp[j])){char ch = num[temp[j] - 'A'];trans += ch;k++;continue;}if (temp[j] == '-')continue;trans += temp[j];k++;}tel[trans]++;}bool flag = true;map<string, int>::iterator it = tel.begin();while (it != tel.end()){if (it->second >= 2){cout << it ->first << " " << it -> second << endl;flag = false;}it++;}if (flag)cout << "No duplicates." << endl;if (nCases != 0)cout << endl;} /// return 0;}
- UVa 755 - 487--3279
- uva 755 487--3279
- UVa 755 - 487--3279
- uva 755 - 487--3279
- UVA 755 487-3279
- UVA 755 - 487--3279
- UVa 755 - 487--3279
- UVa: 755 - 487--3279
- Uva-755-487--3279
- UVA 755 - 487--3279
- UVa 755 487-3279
- UVa 755 487-3279
- UVa 755 - 487--3279
- UVa:755 - 487--3279
- UVa 755 - 487--3279
- Uva 755 487--3279
- UVA - 755 487--3279
- UVA 755 - 487--3279
- 循环队列操作
- /etc/rc.d/rc.local linux启动自动开启某些服务
- hdu 3991 Harry Potter and the Present II
- nandflash驱动分析 针对K9GAG08U0D uboot1.1.6(下)
- SAP VF01/VF02/VF03 Tab Enhancemnt
- UVA 755 487-3279
- 图灵机杂思
- iPhone开发笔记
- 关于erlang的binary
- Ubuntu 12.04下编译Openwrt教程
- 寻找捣乱分子对
- Android中判断是否有声音在播放
- C语言文件操作之----文件的读写
- VMProtect 与 ASProtect 在VC中的SDK编程