hdu4690 EBCDIC ——水题,考耐心
link:http://acm.hdu.edu.cn/showproblem.php?pid=4690
考的是耐心何细心啊,用map把两个表格映射一下就行~
 #include <iostream>
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
 #include <cmath>
 #include <cctype>
 #include <algorithm>
 #include <queue>
 #include <deque>
 #include <queue>
 #include <list>
 #include <map>
 #include <set>
 #include <vector>
 #include <utility>
 #include <functional>
 #include <fstream>
 #include <iomanip>
 #include <sstream>
 #include <numeric>
 #include <cassert>
 #include <ctime>
 #include <iterator>
 const int INF = 0x3f3f3f3f;
 ][] = {{-,},{,},{,-},{,},{-,-},{-,},{,-},{,}};
 using namespace std;
 ][] = {
     "NUL","SOH","STX","ETX","","HT","","DEL","","","","VT","FF","CR","SO","SI",
     "DLE","DC1","DC2","DC3","","","BS","","CAN","EM","","","IFS","IGS","IRS","IUS ITB",
     "","","","","","LF","ETB","ESC","","","","","","ENQ","ACK","BEL",
     "","","SYN","","","","","EOT","","","","","DC4","NAK","","SUB",
     "SP","","","","","","","","","","",".","<","(","+","|",
     "&","","","","","","","","","","!","$","*",")",";","",
     "-","/","","","","","","","","","",",","%","_",">","?",
     "","","","","","","","","","`",":","#","@","'","=","\"",
     "","a","b","c","d","e","f","g","h","i","","","","","","",
     "","j","k","l","m","n","o","p","q","r","","","","","","",
     "","~","s","t","u","v","w","x","y","z","","","","","","",
     "^","","","","","","","","","","[","]","","","","",
     "{","A","B","C","D","E","F","G","H","I","","","","","","",
     "}","J","K","L","M","N","O","P","Q","R","","","","","","",
     "\\","","S","T","U","V","W","X","Y","Z","","","","","","",
     ","","","","","",""
 };
 ][] = {
 "NUL",    "SOH",    "STX",    "ETX",    "EOT",    "ENQ",    "ACK",    "BEL",    "BS",    "HT",    "LF",    "VT",    "FF",    "CR",    "SO",    "SI",
 "DLE",    "DC1",    "DC2",    "DC3",    "DC4",    "NAK",    "SYN",    "ETB",    "CAN",    "EM",    "SUB",    "ESC",    "IFS",    "IGS",    "IRS",    "IUS ITB",
 "SP",    "!",    "\"",    "#",    "$",    "%",    "&",    "'",    "(",    ")",    "*",    "+",    ",",    "-",    ".",    "/",
 ",    ":",    ";",    "<",    "=",    ">",    "?",
 "@",    "A",    "B",    "C",    "D",    "E",    "F",    "G",    "H",    "I",    "J",    "K",    "L",    "M",    "N",    "O",
 "P",    "Q",    "R",    "S",    "T",    "U",    "V",    "W",    "X",    "Y",    "Z",    "[", "\\","]","^","_",
 "`",    "a",    "b",    "c",    "d",    "e",    "f",    "g",    "h",    "i",    "j",    "k",    "l",    "m",    "n",    "o",
 "p",    "q",    "r",    "s",    "t",    "u",    "v",    "w",    "x",    "y",    "z",    "{",    "|",    "}",    "~",    "DEL"
 };
 map<pair<int,int>, pair<int,int> > coll;
 int main(void)
 {
     #ifndef ONLINE_JUDGE
     freopen("in.txt", "r", stdin );
     #endif // ONLINE_JUDGE
     string sad;
     ios::sync_with_stdio(false);
     cin>>sad; coll.clear();
     string tmp; pair<int,int> so, to;
     ; i < ; ++i)
     {
         ; j < ; ++j)
         {
             if (A[i][j]!="")
             {
                 so.first=i, so.second=j;
                 bool mrk = false;
                 ; k < ; ++k)
                 {
                     ; h < ; ++h)
                     {
                         if (A[i][j]==B[k][h])
                         {
                             mrk = true;
                             to.first=k,to.second=h;
                             coll[so] = to; break;
                         }
                     }
                     if (mrk) break;
                 }
             }
         }
     }
     ; i < sad.size(); i+=)
     {
         int X, Y; tmp.clear();
         ;
         ';
         ]>=]<=]- ;
         ] - ';
         pair<int,int> hehe, TM;
         hehe.first = X, hehe.second = Y;
         TM = coll[hehe];
         int j = TM.first, k = TM.second;
         char XX, YY;
         XX = j+ ';
         ) YY = k -  + 'A';
         ';
         printf("%c%c", XX, YY);
     }
     printf("\n");
     ;
 }
写那两个数组没有vim的帮助手是不是得残了……
还有一个就是,当你发现程序某一小段怎么都不对的时候,也许重新写一下就OK了,调试了很久……
走吧,小胖!
hdu4690 EBCDIC ——水题,考耐心的更多相关文章
- 【转】POJ百道水题列表
		以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ... 
- HDOJ 2317. Nasty Hacks 模拟水题
		Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ... 
- ACM :漫漫上学路 -DP -水题
		CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ... 
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
		1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ... 
- [poj2247] Humble Numbers (DP水题)
		DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ... 
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
		1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ... 
- BZOJ 1303 CQOI2009 中位数图 水题
		1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ... 
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
		B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ... 
- ACM水题
		ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ... 
随机推荐
- ElasticSearch学习问题记录——Invalid shift value in prefixCoded bytes (is encoded value really an INT?)
			最近在做一个电商项目,其中商品搜索中出现一个奇怪的现象,根据某个字段排序的时候会出现商品数量减少的情况.按照一般路要么查不出来,要么正常显示,为什么增加了按照销量排序就会出现查询结果减少的情况. 查了 ... 
- 用友华表Cell一些用法小结(cs.net版本)
			//从Color类型得到RGB类型,也可以用ColorTranslator.ToOle()方法 public int GetRGBFromColor(Color color) { byte r = c ... 
- [css]样式合并与模块化
			原文链接:http://www.zhangxinxu.com/wordpress/2010/07/css%E7%9A%84%E6%A0%B7%E5%BC%8F%E5%90%88%E5%B9%B6%E4 ... 
- Linux 控制 配置 减少 交换分区  SWAP 虚拟内存使用
			对于某些大型应用来说,SWAP 严重影响性能,尽可能避免使用: The Linux kernel provides a tweakable setting that controls how ofte ... 
- 浅谈 Android 自定义锁屏页的发车姿势
			作者:blowUp,原文链接:http://mp.weixin.qq.com/s?__biz=MzA3NTYzODYzMg==&mid=2653577446&idx=2&sn= ... 
- win7文件夹图标中多了一把小锁打不开文件夹怎么办?
			win7文件夹图标中多了一把小锁打不开文件夹怎么办?解决办法一:右击目录→取得管理员权限!该方法适用于win7旗舰版.解决办法二:右击目录→属性→安全→高级→选择everyone→更改权限→勾上完全访 ... 
- jquery validate 指定错误内容的位置
			一.默认的提示 messages: { required: "This field is required.", remote: "Please fix this fie ... 
- Laravel 设置时区
			打开laravel框架目录下app/config/app.php 找到参数'timezone'='UTC',设置'timezone'='Asia/Shanghai',时间就正常了. 
- JQuery设置和去除disabled属性
			//两种方法设置disabled属性 $('#areaSelect').attr("disabled",true); $('#areaSelect').attr("dis ... 
- [maven] 常用插件解析
			参考资料:http://my.oschina.net/zh119893/blog/276090 我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完 ... 
