#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include<cstdlib>
#include<cstring>
#include <vector>
#include <queue>
#include <map>
#include <sstream> using namespace std;
#define maxn 100100
map<string, int>ma;
std::vector<string> words;
string func(string str) {
string ans = str;
for (int i = ; i < ans.length(); i++) {
ans[i] = tolower(ans[i]);
} sort(ans.begin(), ans.end());
return ans;
}
int main() {
std::ios::sync_with_stdio(false);
string str;
while (cin >> str) {
if (str[] == '#') {
break;
}
words.push_back(str);
string r = func(str);
if (!ma.count(r)) {
ma[r] = ;
}
ma[r]++;
}
std::vector<string> ans;
for (int i = ; i < words.size(); i++) {
if (ma[func(words[i])] == ) {
ans.push_back(words[i]);
}
sort(ans.begin(), ans.end()); }
for (int i = ; i < ans.size(); i++) {
cout << ans[i] << endl;
}
return ;
}

UVa-156 Ananagrams(map映射)的更多相关文章

  1. UVA 156 Ananagrams ---map

    题目链接 题意:输入一些单词,找出所有满足如下条件的单词:该单词不能通过字母重排,得到输入文本中的另外一个单词.在判断是否满足条件时,字母不分大小写,但在输出时应保留输入中的大小写,按字典序进行排列( ...

  2. uva 156 - Ananagrams (反片语)

    csdn:https://blog.csdn.net/su_cicada/article/details/86710107 例题5-4 反片语(Ananagrams,Uva 156) 输入一些单词,找 ...

  3. UVa 156 Ananagrams(STL,map)

     Ananagrams  Most crossword puzzle fans are used to anagrams--groups of words with the same letters ...

  4. uva 156 (map)

    暑假培训习题 1.用vector<string>储存string类型的输入单词: 2.将vector中的元素逐一标准化后映射进map中,并给map值加一: 3.新建一个空的vector 4 ...

  5. UVA 156 Ananagrams (STL multimap & set)

    原题链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=98&p ...

  6. UVa 156 Ananagrams

    题意:给出一些单词,在这些单词里面找出不能通过字母重排得到的单词(判断的时候不用管大小写),然后按照字典序输出. 学习的紫书的map= = 将每一个单词标准化 先都转化为小写,再排序(即满足了题目中说 ...

  7. STL语法——映射:map 反片语(Ananagrams,UVa 156)

    Description Most crossword puzzle fans are used to anagrams--groups of words with the same letters i ...

  8. ZOJ 3644 Kitty's Game dfs,记忆化搜索,map映射 难度:2

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4834 从点1出发,假设现在在i,点数为sta,则下一步的点数必然不能是sta的 ...

  9. POJ2503——Babelfish(map映射+string字符串)

    Babelfish DescriptionYou have just moved from Waterloo to a big city. The people here speak an incom ...

随机推荐

  1. PHP curl Post请求和Get请求~

    //获取的参数 $api_key = '8a82d53a57b06c1d835d129f7e43d49c'; $orderNum = pdo_fetch('select ddlm_order_no f ...

  2. pyqt5安装与pycharm配置

    最近几天新入坑了python的GUI设计,回想一下我为什么会入门这个???好像是在知乎上看到你都用 Python 来做什么? 这篇文章,看到有人回答说将python打包成exe文件,然后就想把之前弄得 ...

  3. yii DbCriteria相关属性常用方法

    $criteria = new CDbCriteria; //函数方式 $criteria->addCondition("id=1"); //查询条件,即where id = ...

  4. 使用jQuery修改带有!important 的强制样式

    我们习惯性的会用这种方法进行修改: $(".test").css("width","100px !important"); 但是往往是修改失 ...

  5. Keil中查看.c和.h文件的路径

    方法一: 选择任意一个文件,然后点击右键,选择"Option for File xxx"即可查看该文件的路径. 方法二: 单击任意一个文件,然后点击右键,选择"Open ...

  6. Asp.net core Identity + identity server + angular 学习笔记 (第三篇)

    register -> login 讲了 我们来讲讲 forgot password -> reset password  和 change password 吧 先来 forgot pa ...

  7. 构建可扩展的微博架构(qcon beijing 2010演讲)#高并发经验值#

    构建可扩展的微博架构(qcon beijing 2010演讲) http://timyang.net/architecture/microblog-design-qcon-beijing/ 互联网架构 ...

  8. HTL里面使用sling model的时候传参问题

    Question: Can we pass in parameters? <div data-sly-use.myClass=”${ ‘mysite.myproject.HeaderCompon ...

  9. Android测试(二)——adb常用命令

    连接设备: 安装应用包apk文件: adb install apk文件 卸载应用: adb uninstall 包名 将设备中的文件放到本地: adb pull 设备文件目录 本地文件目录 将本地文件 ...

  10. Element-ui表格选中回显

    先瞄一下,是不是你要的效果 然后,废话不多说,直接上代码啦 <template> <div class> <div class="projectData&quo ...