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: ...
随机推荐
- Windows Internals学习笔记(八)IO系统
参考资料: 1. <Windows Internals> 知识点: ● 当一个进
- "旋转的风车"----windows(GDI)绘图
这正是秋季将尽, 冬季未到的时节. 黄土高坡上已滚起了漫天黄沙, 而这里却是万里晴空如练! 风, 丝丝入骨! 未央柳即将枯死的枝条,仍在挣扎. 街道两旁清一色的银杏树叶, 金灿耀眼. 耀的令人感动, ...
- 《K&R》里贯穿全书的代码
个人阅读<K&R>的感觉就是:前后内容联系特别紧密,前面的代码没有理解好到了后面就看不下去. 1.getline(char s[], int lim) 调用结果:往参数数组中读入字 ...
- poj2280Amphiphilic Carbon Molecules(极角排序)
链接 卡了几天的破题,对于hdu的那份数据,这就一神题.. 借助极角排序,枚举以每一个点进行极角排序,然后构造两条扫描线,一个上面一个下面,两条同时走,把上线和下线的点以及上线左边的点分别统计出来,如 ...
- 程序设计入门——C语言 第1周编程练习 1逆序的三位数(5分)
第1周编程练习 查看帮助 返回 第1周编程练习题,直到课程结束之前随时可以来做.在自己的IDE或编辑器中完成作业后,将源代码的全部内容拷贝.粘贴到题目的代码区,就可以提交,然后可以查看在线编译和运 ...
- 解决:“java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut myMethod”问题!
Spring版本:2.5.6 AspectJ是Spring自带的lib. Jdk版本:1.7.0_17 在配置没问题的情况下,报:java.lang.IllegalArgumentException: ...
- Myeclipse 找不到Convert to maven project选项
https://my.oschina.net/u/2419190/blog/504417 Window > Preferences > General > Capabilities ...
- django template
一.模板基本元素 1.例子程序 1)urls.py中新增部分 from django.conf.urls import patterns, url, include urlpatterns = pat ...
- jquery获取(设置)节点的属性与属性值
1. attr(属性名) //获取属性的值(取得第一个匹配元素的属性值.通过这个方法可以方便地从第一个匹配元素中获取一个属性的值.如果元素没有相应属性,则返回 undefined ) 2 ...
- 20145224&20145238《信息安全系统设计基础》实验三
20145224陈颢文20145238荆玉茗 <信息安全系统设计基础>第五次实验报告 课程:信息安全系统设计基础 班级: 1452 姓名:荆玉茗 陈颢文 学号:20145238 20145 ...