#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. SpringMVC成员变量并发状态下使用测试

    1.SpringMVC默认是单例的,使用成员变量在并发状态下该成员变量的值是被共享的 测试平台 我们目前正在开发的电商项目  (架构组成SpringCloud + SpringBoot + Sprin ...

  2. Sonar 配置及部署(windows系统)

    Sonar 是一个用于代码质量管理的开放平台.通过插件机制,Sonar 可以集成不同的测试工具,代码分析工具,以及持续集成工具. 与持续集成工具(例如 Hudson/Jenkins 等)不同,Sona ...

  3. 小程序之 swiper高度根据图片高度变化

    今天做的是这个效果⬇️  swiper的高度根据图片的高度而改变 wxml:<swiper indicator-dots="{{indicatorDots}}" vertic ...

  4. structure streaming笔记

    基于micro-batch, spark2.3之后, 支持continues processing 基于spark SQL 如同在静态table上运行标准批查询一样表现流计算, spark 通过在一个 ...

  5. AT2412 最大の和

    传送门 思路: 线段树暴力枚举区间,查询最大区间和. Code: #include<iostream> #include<cstdio> #include<algorit ...

  6. C#中得到程序当前工作目录和执行目录的五种方法

    string str="";str += "\r\n" + System.Diagnostics.Process.GetCurrentProcess().Mai ...

  7. 第 9 章 数据管理 - 074 - 如何安装和配置 Rex-Ray?

    Rex-Ray 安装和配置方法 Rex-Ray 是一个优秀的 Docker volume driver 安装和配置方法 Rex-Ray 以 standalone 进程的方式运行在 Docker 主机上 ...

  8. APP多开教程

    https://bbs.feng.com/read-htm-tid-11793134.html 本教程原创,送给有需要的人.本人就为了多开百度云盘传数据,故多开两个百度云盘,亲测一周多没毛病.微信多开 ...

  9. channels 2.x的使用

    转载:https://www.vimiix.com/post/2018/07/26/channels2-tutorial/ 认识 Channels 之前,需要先了解一下 asgi ,全名:Asynch ...

  10. jemter分布式部署及linux下分布式脚本执行

    jmeter进行接口性能测试,占用内存较大,在模拟千万计并发用户时,使用分布式部署进行分压测试. 操作步骤:选择一台机器作为调度机,其他机器作为执行机 一.jmeter分布式部署 前提条件:A.执行机 ...