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: ...
随机推荐
- (三)kafka集群扩容后的topic分区迁移
kafka集群扩容后的topic分区迁移 kafka集群扩容后,新的broker上面不会数据进入这些节点,也就是说,这些节点是空闲的:它只有在创建新的topic时才会参与工作.除非将已有的partit ...
- android studio gradle升级
http://services.gradle.org/distributions 下载最新的gradle-3.0-all.zip包 放入C:\Users\Administrator\.gradle\w ...
- C#导出csv文件 支持中文的解决方案
#region 导出CSV下载 string exportFileName = "Export" + DateTime.Now.ToString("yyyyMMddHHm ...
- 【汇编】mov [1000],bx:immediate operand not allowed
],bx;在目的操作数中编译器会忽略[],所以[1000]就成了立即数,出现“immediate operand not allowed”改: ;mov bx,[1000];而在源操作数中,就不会出现 ...
- iOS开发多线程篇—NSOperation基本操作
iOS开发多线程篇—NSOperation基本操作 一.并发数 (1)并发数:同时执⾏行的任务数.比如,同时开3个线程执行3个任务,并发数就是3 (2)最大并发数:同一时间最多只能执行的任务的个数. ...
- [ie兼容]ie7 margin-bottom失效
有时候子元素设置了margin,父元素也设置了margin,父元素的margin在ie7下会失效(包括padding) 解决方法:父容器加属性overflow:hidden;zoom:100%;
- 微信、QQ浏览器X5内核问题汇总
一. 资料汇总 1.前端H5调起QQ浏览器的总结:http://km.oa.com/group/22486/articles/show/210189?kmref=search 2.Android We ...
- 使用squid配置透明代理并对上网行为进行控制
使用Squid配置透明代理 环境:CentOS 6.4 + squid-3.1.10-20.el6_5.3.x86_64 1.检查squid是否默认安装,没有安装先安装 rpm -qa squid 假 ...
- SVN - 忽略已经提交的文件
1.在本地删除要忽略的文件 2.与资源库同步,提交删除的文件 3.忽略文件
- ubuntu下firefox浏览器flash player插件的安装
自从装了双系统后,ubuntu下的音乐软件只能选择网页播放器了,这无疑是需要播放插件的,这个插件就是falsh player. 当初使用usb启动盘安装的,在安装的过程中还会报找不到CD-rom的错, ...