Ancient Cipher UVa1339
这题就真的想刘汝佳说的那样,真的需要想象力,一开始还不明白一一映射是什么意思,到底是有顺序的映射?还是没顺序的映射?
答案是没顺序的映射,只要与26个字母一一映射就行
下面给出代码
//Uva1339
//Ancient Cipher
//easy
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main() {
freopen("Ancient.in","r",stdin);
freopen("Ancient.out","w",stdout);
], s2[];
) {
int n = strlen(s1);
], cnt2[];
memset(cnt1, , sizeof(cnt1));
memset(cnt2, , sizeof(cnt2));
; i < n; i++)cnt1[s1[i] - 'A']++;
; i < n; i++)cnt2[s2[i] - 'A']++;
sort(cnt1, cnt1 + );
sort(cnt2, cnt2 + );
;
; i < ; i++)
;
if(ok)printf("YES\n");
else printf("NO\n");
}
;
}
Ancient Cipher UVa1339的更多相关文章
- uva--1339 - Ancient Cipher(模拟水体系列)
1339 - Ancient Cipher Ancient Roman empire had a strong government system with various departments, ...
- UVa 1339 Ancient Cipher --- 水题
UVa 1339 题目大意:给定两个长度相同且不超过100个字符的字符串,判断能否把其中一个字符串重排后,然后对26个字母一一做一个映射,使得两个字符串相同 解题思路:字母可以重排,那么次序便不重要, ...
- Poj 2159 / OpenJudge 2159 Ancient Cipher
1.链接地址: http://poj.org/problem?id=2159 http://bailian.openjudge.cn/practice/2159 2.题目: Ancient Ciphe ...
- UVa1399.Ancient Cipher
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- poj 2159 D - Ancient Cipher 文件加密
Ancient Cipher Description Ancient Roman empire had a strong government system with various departme ...
- POJ2159 Ancient Cipher
POJ2159 Ancient Cipher Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 38430 Accepted ...
- POJ2159 ancient cipher - 思维题
2017-08-31 20:11:39 writer:pprp 一开始说好这个是个水题,就按照水题的想法来看,唉~ 最后还是懵逼了,感觉太复杂了,一开始想要排序两串字符,然后移动之类的,但是看了看 好 ...
- 2159 -- Ancient Cipher
Ancient Cipher Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 36074 Accepted: 11765 ...
- [算法竞赛入门经典]Ancient Cipher, NEERC 2004,UVa1339
Description Ancient Roman empire had a strong government system with various departments, including ...
随机推荐
- js prototype 和constructor
1.function 和object 都有 constructor 和prototype 2. var a=new Animal() (animal 是function或Object) a 有 con ...
- php 利用socket上传文件
php 利用socket上传文件 张映 发表于 2010-06-02 分类目录: php 一,利用fsockopen来上传文件 以前我写过一篇关于socket通信原理的博文http://blog.51 ...
- 一种新的隐藏-显示模式诞生——css3的scale(0)到scale(1)
.dropdown-menu { background: rgba(255, 255, 255, 0.98) none repeat scroll 0 0; box-shadow: 0 1px 2 ...
- UnitOfWork实战
企业模式之Unit Of Work模式 在开始UnitOfWork模式之前有必要回顾下我们耳熟能详的Data Access Object(DAO)模式,即数据访问对象.DAO是一种简单的模式,我们构建 ...
- keystore 介绍
Keytool 是一个有效的安全钥匙和证书的管理工具. Java 中的 keytool.exe (位于 JDK\Bin 目录下)可以用来创建数字证书,所有的数字证书是以一条一条(采用别名区别)的形式存 ...
- Firefox恢复书签
Firefox虽然有网络同步功能,但是网络账户中没有保存历史书签.一旦电脑故障,书签可能会丢失,更要命的是自动同步後,网上书签也被覆盖的一干二净.怎么办呢? 大多数时候还是可以在本机找回书签 1:打开 ...
- Sigmoid函数
Sigmoid函数是一个S型函数. Sigmoid函数的数学公式为: 它是常微分方程 的一个解. Sigmoid函数具有如下基本性质: 定义域为 值域为, 为有界函数 函数在定义域内为连续和光滑函数 ...
- Js把IE COM数组列表转换成数组
今天写组件的时候遇到一个问题,就是当我需要对获取到的对象列表进行删减的时候,发现没有合适的方法,比如: //获取图片列表 var imgs = document.getElementsByTagNam ...
- js原生设计模式——9外观模式封装
1.事件处理程序兼容性封装 <!DOCTYPE html><html lang="en"><head> <meta charset= ...
- 如何让sql自动定时执行某个存储过程
/*--创建作业--邹建 2003.10--*//*--调用示例--每月执行的作业exec p_createjob @jobname='mm',@sql='select * from syscolum ...