博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UVA 156 Ananagrams ---map
阅读量:4568 次
发布时间:2019-06-08

本文共 631 字,大约阅读时间需要 2 分钟。

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

刘汝佳算法竞赛入门经典(第二版)P113

#include 
#include
#include
#include
#include
#include
#include
#include
using namespace std;string repr(const string& s){ string ans=s; for(int i=0;i
cnt;vector
words;int main(){ int n=0; string s; while(cin>>s) { if(s[0]=='#') break; words.push_back(s); string r=repr(s); if(!cnt.count(r)) cnt[r]=0; cnt[r]++; } vector
ans; for(int i=0;i

 

转载于:https://www.cnblogs.com/Ritchie/p/5940152.html

你可能感兴趣的文章
关于Java的Daemon线程的理解
查看>>
Android开发之WebService介绍
查看>>
多线程死锁发生情景之一:同步的嵌套
查看>>
RestFramework之解析器
查看>>
Redis安装异常解决办法
查看>>
android开发时gen和bin目录的SVN管理(转)
查看>>
Jsonp post 跨域方案
查看>>
30分钟 让你成为一个更好的程序员
查看>>
使用HTML5开发离线应用 - cache manifest
查看>>
深入理解C语言 - 指针使用的常见错误
查看>>
JAVA Excel API学习案例
查看>>
网页打开速度慢的原因及N种解决方法
查看>>
监控线上服务的小脚本
查看>>
ultraedit 实际应用技巧
查看>>
mysql_select 单表查询
查看>>
磁盘配额
查看>>
dns视图搭建
查看>>
WPF 中动态改变控件模板
查看>>
ubuntu Ctrl+Alt+F1 进入终端字符界面 登录出现login incorrect解决办法
查看>>
珍爱生命,远离JS=>JS避坑记
查看>>