这题就真的想刘汝佳说的那样,真的需要想象力,一开始还不明白一一映射是什么意思,到底是有顺序的映射?还是没顺序的映射?

答案是没顺序的映射,只要与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的更多相关文章

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

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

  2. UVa 1339 Ancient Cipher --- 水题

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

  3. Poj 2159 / OpenJudge 2159 Ancient Cipher

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

  4. UVa1399.Ancient Cipher

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

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

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

  6. POJ2159 Ancient Cipher

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

  7. POJ2159 ancient cipher - 思维题

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

  8. 2159 -- Ancient Cipher

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

  9. [算法竞赛入门经典]Ancient Cipher, NEERC 2004,UVa1339

    Description Ancient Roman empire had a strong government system with various departments, including ...

随机推荐

  1. jstree使用小结(二)

    继续上一篇: 1.数据 按照官网的json数据返回格式: 有两种格式,我使用的格式如下: $('#jstree1').jstree({ 'core' : { 'data' : [ { "id ...

  2. TFS2013 升级至TFS2015及项目的创建

    TFS2015已发布想体验下新特性 由于现有数据库已经是SQLSERVER2012 SP1 开发工具VS2013 都符合升级要求 现在体验下吧 1.先下载TFS2015 运行安装向导一路NEXT 直至 ...

  3. Linq左关联 右关联 内关联

    1.左连接: var LeftJoin = from emp in ListOfEmployees join dept in ListOfDepartment on emp.DeptID equals ...

  4. .NET Core installation guide

      .NET Core installation guide 1.Download Visual Studio 2015 Make sure you have Visual Studio 2015 U ...

  5. VirtualBox 安装增强工具

    菜单的: Device>insert  guest addtion. 定位: cd /media/cdrom 安装: sudo sh ./VBoxLinuxAdditions-x86.run 然 ...

  6. NPM 简单实用说明

    https://nodejs.org/en/download/ 下载并按照,直接下一步就可以,最后会在C:\Program Files 新建一个nodejs文件夹,里面有一个node.exe.双击就启 ...

  7. Cell.reuseIdentifier 指什么

    Cell.reuseIdentifier 指的是 默认为空,如果不定义,在执行 [_tableView registerNib:templateCellNib forCellReuseIdentifi ...

  8. bug工具

    在线工具:柠檬bug管理--兼顾项目管理 开源工具:PPM Bug 缺陷管理系统 项目管理.bug管理:http://www.bugfree.cn

  9. Mybatis学习(8)逆向工程

    什么是逆向工程: mybaits需要程序员自己编写sql语句,mybatis官方提供逆向工程 可以针对单表自动生成mybatis执行所需要的代码(mapper.java,mapper.xml.po.. ...

  10. 选项卡(TabHost)的功能与用法

    TabHost是一种非常实用的组件,TabHost可以很方便地在窗口上放置多个便签页,每个标签页相当于获得了一个与外部容器相同大小的组件摆法区域.通过这种方式,就可以在一个容器里放置更多组件,例如手机 ...