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 ...
随机推荐
- hdu 1018
数学题 用的这个方法比较烂 g++超时 c++ 406ms /******************************************************************* ...
- Samza在YARN上的启动过程 =》 之二 submitApplication
首先,来看怎么构造一个org.apache.hadoop.yarn.client.api.YarnClient class ClientHelper(conf: Configuration) exte ...
- Linux---Ls命令 初级实现
By xxx0624Done: ls ls -a ls -l ls /tmp ls -R ls -t FileName color FileName o ...
- 获取Android系统时间
目的: 输入 2014-09-09 14:02:03 输出 等待:1小时20分 注意: HH:mm:ss 为获取手机 24小时格式的时间 15:03 hh:mm:ss 为12小时模式的时 ...
- 【NOIP 2016 总结】
距离杯赛已经很久了,然而我现在才打总结.. 我好惨的说..两场才380... DAY 1 第一题 toy 送分题,模拟的时候+一下再mod一下就好. [当时打完这题就没再看一眼了,好方的说] #inc ...
- 【mysql的设计与优化专题(2)】数据中设计中的范式与反范式
设计关系数据库时,遵从不同的规范要求,设计出合理的关系型数据库,这些不同的规范要求被称为不同的范式,各种范式呈递次规范,越高的范式数据库冗余越小.但是有些时候一昧的追求范式减少冗余,反而会降低数据读写 ...
- (转) MFC的入口点与消息循环,消息映射
博文分析的很不错,尤其是替换默认窗口过程的这块,本人觉得,所有的这些都可以参阅侯杰的<深入浅出MFC >. 来自:http://blog.csdn.net/sryan/article/de ...
- windows下配置环境变量时,在cmd窗口执行配置的命令时无效的原因
一个原因肯定就是配置错误,这个就要自己仔细去检查了,如果确信配置正确,可能是你的cmd窗口在环境变量配置之前就打开的,在配置好环境变量之后,在cmd窗口执行命令是看不到效果的,可以关掉cmd窗口再重新 ...
- Vim的撤销与重做
命令模式下 u:撤销 Ctrl+r:重做(撤销撤销)
- Microsoft.Data.ConnectionUI.DataConnectionDialog
MicrosoftVisualStudio里面的资源之数据库连接配置 这个功能的实现主要是用了Microsoft.Data.ConnectionUI.dll和Microsoft.Data.Connec ...