HDU-4690 EBCDIC 映射,模拟,沙茶
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4690
纯沙茶模拟题。。。
//STATUS:C++_AC_93MS_228KB
#include <functional>
#include <algorithm>
#include <iostream>
//#include <ext/rope>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;
//#pragma comment(linker,"/STACK:102400000,102400000")
//using namespace __gnu_cxx;
//define
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define PI acos(-1.0)
//typedef
typedef __int64 LL;
typedef unsigned __int64 ULL;
//const
const int N=;
const int INF=0x3f3f3f3f;
const int MOD=,STA=;
const LL LNF=1LL<<;
const double EPS=1e-;
const double OO=1e15;
const int dx[]={-,,,};
const int dy[]={,,,-};
const int day[]={,,,,,,,,,,,,};
//Daily Use ...
inline int sign(double x){return (x>EPS)-(x<-EPS);}
template<class T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T> T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T> inline T lcm(T a,T b,T d){return a/d*b;}
template<class T> inline T Min(T a,T b){return a<b?a:b;}
template<class T> inline T Max(T a,T b){return a>b?a:b;}
template<class T> inline T Min(T a,T b,T c){return min(min(a, b),c);}
template<class T> inline T Max(T a,T b,T c){return max(max(a, b),c);}
template<class T> inline T Min(T a,T b,T c,T d){return min(min(a, b),min(c,d));}
template<class T> inline T Max(T a,T b,T c,T d){return max(max(a, b),max(c,d));}
//End int hs[N][N]={
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
{,,,,,,,,,,,,,,,},
}; char ma[]="0123456789ABCDEF"; inline int getnum(char c)
{
return c<=''?c-'':c-'A'+;
} int main(){
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
int i,j,x,y;
char c1,c2;
while((c1=getchar())!='\n')
{
c2=getchar();
x=getnum(c1);
y=getnum(c2);
printf("%c%c",ma[hs[x][y]/],ma[hs[x][y]%]);
}
putchar('\n');
return ;
} /*
NUL SOH STX ETX . HT . DEL . . . VT FF CR SO SI
DLE DC1 DC2 DC3 . . BS . CAN EM . . IFS IGS IRS IUSITB
. . . . . 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 . . . . . .
0 1 2 3 4 5 6 7 8 9 . . . . . . 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 IUSITB
SP ! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ 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 for(i=0;i<16;i++){
for(j=0;j<16;j++)
scanf("%s",E[i][j]);
}
for(i=0;i<8;i++){
for(j=0;j<16;j++)
scanf("%s",A[i][j]);
}
mem(hs,0);
for(i=0;i<16;i++){
for(j=0;j<16;j++){
if(!strcmp(E[i][j],".") && (i!=4 || j!=11))continue;
for(int p=0;p<8;p++){
for(int q=0;q<16;q++)
if(!strcmp(E[i][j],A[p][q])){
hs[i][j]=p*16+q;
}
}
}
}
for(i=0;i<16;i++){
printf("{%d",hs[i][0]);
for(j=1;j<16;j++){
printf(",%d",hs[i][j]);
}
printf("},\n");
}
*/
HDU-4690 EBCDIC 映射,模拟,沙茶的更多相关文章
- HDU 4690 EBCDIC 2013 Multi-University Training Contest 9
解题报告:一个模拟题,有两张表格,然后输入一个字符在第一章表格中的位置,让你找出这个字符在第二章表对应的位置. 我欧诺个的是暴力打表,输了两百多个数字,时间复杂度直接降到O(1),这题觉得比较坑的就是 ...
- HDU 4690 EBCDIC (2013多校 1005题 胡搞题)
EBCDIC Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Su ...
- hdu 4690 EBCDIC
还有什么好说的呢?打表题= = #include<cstdio> #include<cstring> #include<algorithm> #include< ...
- 【沙茶了+筛选保存最大质因数】【HDU2136】Largest prime factor
Largest prime factor Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- HDU 5510---Bazinga(指针模拟)
题目链接 http://acm.hdu.edu.cn/search.php?action=listproblem Problem Description Ladies and gentlemen, p ...
- HDU 5047 Sawtooth(大数模拟)上海赛区网赛1006
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5047 解题报告:问一个“M”型可以把一个矩形的平面最多分割成多少块. 输入是有n个“M",现 ...
- HDU 4041 Eliminate Witches! --模拟
题意: 给一个字符串,表示一颗树,要求你把它整理出来,节点从1开始编号,还要输出树边. 解法: 模拟即可.因为由括号,所以可以递归地求,用map存对应关系,np存ind->name的映射,每进入 ...
- HDU 5965 扫雷 【模拟】 (2016年中国大学生程序设计竞赛(合肥))
扫雷 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submissi ...
- HDU 5935 Car 【模拟】 (2016年中国大学生程序设计竞赛(杭州))
Car Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submiss ...
随机推荐
- Akka Stream文档翻译:Motivation
动机 Motivation The way we consume services from the internet today includes many instances of streami ...
- 在MAC下调试运行暗黑全世界客户端及部分代码注解(基于Firefly)
原地址:http://www.myexception.cn/program/1399860.html 在MAC下调试运行暗黑全世界客户端及部分代码注解(基于Firefly) 在MAC下调试运行暗黑世界 ...
- Java 8 vs. Scala(一): Lambda表达式
[编者按]虽然 Java 深得大量开发者喜爱,但是对比其他现代编程语言,其语法确实略显冗长.但是通过 Java8,直接利用 lambda 表达式就能编写出既可读又简洁的代码.作者 Hussachai ...
- jmeter summariser(命令行执行时的输出) 、查看结果树等结果中文乱码
在使用jmeter测试时,如果你的sampler名字为中文.或者输出的结果信息有中文,你会发现它们都是乱码,非常蛋碎!原因是: jmeter的默认编码为:ISO-8859-1, 解决方案就是要修改它 ...
- 【BZOJ 3190】 3190: [JLOI2013]赛车 (半平面交)
3190: [JLOI2013]赛车 Description 这里有一辆赛车比赛正在进行,赛场上一共有N辆车,分别称为个g1,g2--gn.赛道是一条无限长的直线.最初,gi位于距离起跑线前进ki的位 ...
- java中List集合及其遍历详解
1. 首先List<E>集合继承与Collection<E>,是一个接口. ① Collection (集合框架是JDK1.2版本出现的) ② list:是有序的,元素可 ...
- eclipse实现JavaWeb应用增量打包
很多情况下,项目是不允许全量发布的,所以你得把有做修改的文件一个个挑出来,如果有成千上百的文件,你是不是要头大了? 以下方法应该可以让你得到解救!前提是你是用装有svn plugin的eclipse上 ...
- RTL 与 technology schematic的区别,包含概念与实例
2013-06-25 16:40:45 下面是xilinx官网上的问答贴: http://china.xilinx.com/support/answers/41500.htm#solution The ...
- mysql rr 查询出现的事务情况
select * from INFORMATION_SCHEMA.INNODB_TRX\G The INNODB_TRX table contains information about every ...
- [PHP] - 逗号和点号的区别
比如:1. echo 'abc'.'def'; //用点号连接字符串 2. echo 'abc','def'; //用逗号连接字符串 也许很多人都知道逗号要比点号快.但是不知道为什么.更不知道这两者到 ...