题目链接:http://poj.org/problem?id=2159

#include <cstring>
#include <cstdio>
#include <cctype>
char ch1[102];
char ch2[102];
int n1[102];
int n2[102];
int ch1n[26];
int ch2n[26];
int main(){
scanf("%s %s",ch2,ch1);
int len=strlen(ch1);
if(strlen(ch2)!=len){
printf("NO\n");
return 0;
}
for(int i=0;i<len;i++){
int ti=ch1[i]-'A';
int tj=ch2[i]-'A';
ch1n[ti]++;
ch2n[tj]++;
}
for(int i=0;i<26;i++){
n1[ch1n[i]]++;
n2[ch2n[i]]++;
}
for(int i=0;i<102;i++){
if(n1[i]!=n2[i]){
printf("NO\n");
return 0;
}
}
printf("YES\n");
return 0;
}

POJ 2159 Ancient Cipher 难度:0的更多相关文章

  1. POJ 2159 Ancient Cipher

    题意:被题意杀了……orz……那个替换根本就不是ASCII码加几……就是随机的换成另一个字符…… 解法:只要统计每个字母的出现次数,然后把数组排序看相不相同就行了…… 代码: #include< ...

  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. POJ 1068 Parencodings 模拟 难度:0

    http://poj.org/problem?id=1068 #include<cstdio> #include <cstring> using namespace std; ...

  5. POJ2159 ancient cipher - 思维题

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

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

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

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

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

  8. UVa1399.Ancient Cipher

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

  9. POJ2159 Ancient Cipher

    POJ2159 Ancient Cipher Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 38430   Accepted ...

随机推荐

  1. [转载] 理解 epoll 的事件触发机制

    原文: http://weibo.com/p/1001603862394207076573?sudaref=weibo.com epoll的I/O事件触发方式有两种模式:ET(Edge Trigger ...

  2. Oracle 中union的用法

    UNION 指令的目的是将两个 SQL 语句的结果合并起来,可以查看你要的查询结果. 例如: SELECT Date FROM Store_Information UNION SELECT Date ...

  3. SQL SERVER 2008函数大全(含例子)

    --SQL SERVER 2008 函数大全 /* author:TracyLee csdncount:Travylee */ /* 一.字符串函数: 1.ascii(字符串表达式)    返回字符串 ...

  4. virtualbox中centos系统配置nat+host only上网(zhuan)

    http://www.cnblogs.com/leezhxing/p/4482659.html **************************************************** ...

  5. linux下tftp安装与设置

    在学习linux+arm开发的时候,tftp和NFS是必不可少的环境.这里总结一下自己安装和使用tftp的一些经验,做个备忘. 一.tftp服务原理 tftp(trivial file transfe ...

  6. dedecms 模板文件不存在,无法解析文档"的终极各种解决办法

    方法一:[此对应喜欢把模板文件使用".html"的格式,]  /include/arc.archives.class.php 556行    if (!preg_match(&qu ...

  7. maven 添加支持编译jdk1.7

     1.在<profiles>元素内增加如下内容   <profile>     <id>jdk17</id>     <activation> ...

  8. fushioncharts的使用教程

    FusionCharts 是使用javascript 实现统计图表的js组件:其官网地址:http://www.fusioncharts.com.其早期版本FusionCharts Free 是基于f ...

  9. arithmetic

    字典序算法 http://www.cnblogs.com/darklights/p/5285598.html 字典排序(lexicographical order)是一种对于随机变量形成序列的排序方法 ...

  10. js二级导航

    js写二级导航要点 1.ul li 2.js获取元素 3.setInterval(function(),time); 代码如下 <style type="text/css"& ...