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: ...
随机推荐
- Python学习笔记(0)
Python 是什么类型的语言 Python是脚本语言 Python下载地址:https://www.python.org/downloads/ Python版本:Python 3.4.2 - 64b ...
- js插入动态脚本
原文章:https://www.w3cmm.com/dom/insert-javascript.html 动态脚本指的是在页面加载时不存在,但将来的某一时刻通过修改该DOM动态添加的脚本.和操作HTM ...
- (function($){}) 和$(function(){}) 和$(function($){}) 区别
请问下(function($){}) 和$(function(){}) 和$(function($){}) 有什么区别 谢谢 一.先看 jQuery(function(){ }); 全写为 jQuer ...
- js String对象中常用方法小结(字符串操作)
1.charCodeAt方法返回一个整数,代表指定位置字符的Unicode编码. strObj.charCodeAt(index) 说明: index将被处理字符的从零开始计数的编号.有效值为0到字符 ...
- eclise 部署web工程报 There are no resources that can be added or removed from the server.
该文章转自: http://blog.csdn.net/dw_java08/article/details/7789601 eclise 部署web工程报 There are no resources ...
- tomcat通过conf-Catalina-localhost目录发布项目详解 摘自:http://www.cnblogs.com/iyangyuan/archive/2013/09/12/3316444.html
Tomcat发布项目的方式大致有三种,但小菜认为通过在tomcat的conf/Catalina/localhost目录下添加配置文件,来发布项目,是最佳选择. 因为这样对tomcat的入侵性最小,只需 ...
- sql server 子找父和父找子
父找子 with RTD1 as( select Id,pid from Sys_XCode ), RTD2 as( select * from RTD1 where id=1 union all s ...
- c# 配置文件之configSections配置(三)
使用IConfigurationSectionHandler配置configSections ·步骤1:定义一个实体类 using System; using System.Collections.G ...
- oracle生成行方法
数据库记录是行的集合 set of row, 那么如何如何生成集合呢? oracle中常用的是 递归查询(with ... union all ...) 以及 connect by(树形查询) htt ...
- 谈谈eclipse使用技巧二
上节说道了怎么使用eclipse使您事半功倍.这节告诉您怎么用eclipse练成火眼金睛. ①借你一双火眼金睛让类的层次结构一目了然让你阅读代码如虎添翼 一个好的类的层次结构,让你的类的层次清晰明了, ...