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: ...
随机推荐
- KVC与KVO
KVC:键值编码(Key-Value-Coding),是一个非正式的Protocol,提供一种机制间接访问对象的属性,是路径访问的规范: KVO:键值观察 (Key-Value-Observe),是基 ...
- C/C++与Matlab混合编程
Matlab 拥有丰富的功能,编程简单.不过,有些情况下,Matlab程序的执行速度比较慢.C/C++编译执行的程序速度比较快,编程难度上比Matlab要高一些.因此存在一种方案,就是使用Matlab ...
- JQuery中对各种域进行隐藏和显示操作
操作的基本步骤: (1)导入jquery相关jar <script type="text/javascript" src="jquery-1.1.3.pack.js ...
- vs2010 vc++ 统一修改所有工程的目录配置
vs2005和vs2008中都是通过 工具-选项-项目和解决方案-VC++目录,设置 头文件include .库文件lib.可执行文件dll的路径,以便在引用dll动态链接库文件时,可以查找到该文件的 ...
- js之oop <三>属性标签
读取属性标签 获取对象属性标签,用 Object.getOwnPropertyDescriptor方法.getOwnPropertyDescriptor(); 参数:属性所在对象(object),属性 ...
- 被table单元格colspan属性折磨了
基础知识不牢固,被colspan折磨了很长时间 table里面的td使用colspan前提条件是所跨的单元格宽度必须一样,不然显示效果会是属性不起作用或直接导致表格变形,下面的例子可以看出效果 < ...
- 如何浏览并管理 Outlook 邮件?
当你的邮件多起来的时候你就不得不考虑这个问题了,如何处理各种邮件? 如何浏览并管理 Outlook 邮件? 待续~
- MySQL浮点计算存在的问题与解决方案
如有疑问请联系微信:onesoft007 在计算机中,浮点数往往很难精确表示,那么浮点数运算结果也往往难以精确表示.MySQL同样也存在这个问题,并表现在如下几个方面. 问题 1.相同的输入,可 ...
- html知识——表单
1.表单标记:<form>内容</form> 属性: name(表单名称) 必须写!!! method(传送数据方式): get--将表单的内容附加在URL地址的后面 ...
- Bootstrap自带的chart插件
<!doctype html> <html> <head> <title>Line Chart</title> <script src ...