题意:被题意杀了……orz……那个替换根本就不是ASCII码加几……就是随机的换成另一个字符……

解法:只要统计每个字母的出现次数,然后把数组排序看相不相同就行了……

代码:

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<limits.h>
#include<time.h>
#include<stdlib.h>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#define LL long long using namespace std; int main()
{
string s1, s2;
while(cin >> s1 >> s2)
{
vector <int> v1, v2;
for(int i = 0; i < 26; i++)
{
v1.push_back(0);
v2.push_back(0);
}
for(int i = 0; i < s1.size(); i++)
{
v1[s1[i] - 'A']++;
v2[s2[i] - 'A']++;
}
sort(v1.begin(), v1.end());
sort(v2.begin(), v2.end());
if(v1 == v2) puts("YES");
else puts("NO");
}
return 0;
}

  

POJ 2159 Ancient Cipher的更多相关文章

  1. POJ 2159 Ancient Cipher 难度:0

    题目链接:http://poj.org/problem?id=2159 #include <cstring> #include <cstdio> #include <cc ...

  2. Poj 2159 / OpenJudge 2159 Ancient Cipher

    1.链接地址: http://poj.org/problem?id=2159 http://bailian.openjudge.cn/practice/2159 2.题目: Ancient Ciphe ...

  3. 2159 -- Ancient Cipher

    Ancient Cipher Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 36074   Accepted: 11765 ...

  4. POJ2159 ancient cipher - 思维题

    2017-08-31 20:11:39 writer:pprp 一开始说好这个是个水题,就按照水题的想法来看,唉~ 最后还是懵逼了,感觉太复杂了,一开始想要排序两串字符,然后移动之类的,但是看了看 好 ...

  5. poj 2159 D - Ancient Cipher 文件加密

    Ancient Cipher Description Ancient Roman empire had a strong government system with various departme ...

  6. uva--1339 - Ancient Cipher(模拟水体系列)

    1339 - Ancient Cipher Ancient Roman empire had a strong government system with various departments, ...

  7. UVa 1339 Ancient Cipher --- 水题

    UVa 1339 题目大意:给定两个长度相同且不超过100个字符的字符串,判断能否把其中一个字符串重排后,然后对26个字母一一做一个映射,使得两个字符串相同 解题思路:字母可以重排,那么次序便不重要, ...

  8. UVa1399.Ancient Cipher

    题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  9. Ancient Cipher UVa1339

    这题就真的想刘汝佳说的那样,真的需要想象力,一开始还不明白一一映射是什么意思,到底是有顺序的映射?还是没顺序的映射? 答案是没顺序的映射,只要与26个字母一一映射就行 下面给出代码 //Uva1339 ...

随机推荐

  1. Test a ; vs Test a( ) ;

    一. Test a();   Test a;  //前提声明了Test类 前者声明一个返回值为Test,名为a的函数,后者声明了Test类的一个对象(把Test当成int) struct Test{ ...

  2. HDU4276 The Ghost Blows Light SPFA&&树dp

    题目的介绍以及思路完全参考了下面的博客:http://blog.csdn.net/acm_cxlove/article/details/7964739 做这道题主要是为了加强自己对SPFA的代码的训练 ...

  3. 使用git代替FTP部署代码到服务器的例子

    这篇文章主要介绍了使用git代替FTP部署代码到服务器的例子,这种方法可以节省流量.节省时间,需要的朋友可以参考下 本地开发完成后,通常会在服务器上部署,有人会使用ftp,有人会使用scp, ftp和 ...

  4. POJ1328Radar Installation

    http://poj.org/problem?id=1328 题的大意就是说在海里有小岛,坐标位置会给出,需要岸边的雷达覆盖所有的小岛,但雷达的覆盖范围有限,所以,需要最少的雷达覆盖所有的小岛,但若是 ...

  5. C Primer Plus之高级数据表示

     抽象数据类型(ADT)    类型是由什么组成?一个类型(type)指定两类信息:一个属性集和一个操作集. 所以您想定义一个新的数据类型.首先,您需要提供存储数据的方式,可能是通过设计一个结构.第二 ...

  6. Oracle日期函数

    Oracle日期函数用于对Oracle数据库中的日期及时间进行处理. (1)ADD_MONTHS Oracle日期函数返回一个具有与所提供日期相差月份的日期,函数中给出了未来或以前的月份数.语法如下: ...

  7. hdu1022 Train Problem I

    http://acm.hdu.edu.cn/showproblem.php?pid=1022 #include<iostream> #include<stdio.h> #inc ...

  8. P1024 外星人的密码数字

    P1024 外星人的密码数字 时间: 1000ms / 空间: 131072KiB / Java类名: Main 描述     XXXX年突然有外星人造访,但大家语言不通,不过科学家们经过研究发现外星 ...

  9. [hackerrank]Manasa and Stones

    https://www.hackerrank.com/contests/w2/challenges/manasa-and-stones 简单题. #include<iostream> us ...

  10. Orcle数据库查询练习复习:二

    一.题目 1.找出所有成绩均低于80的学生姓名 select sname from student where sid in( ) select sname from student where si ...