HDU3257 Hello World!
Hello World!
I've sent you a nice font for you to use, but I'm too busy to tell you how. Can you help yourself?
Each case begins with an integer C (1 <= C <= 80) in a single line, then each of the following C lines contains five two-digit numbers in hex (letters will be in uppercase). Don't ask me what they mean, I'm too busy...
After that, print all T characters. Use a single blank column of spaces between two consecutive characters. Each line should have exactly 6C-1 character (again, don't ask me why).
Don't forget to print another blank line after the output of each test case.
2
11
7F 08 08 08 7F
38 54 54 54 18
00 41 7F 40 00
00 41 7F 40 00
38 44 44 44 38
00 00 00 00 00
3F 40 38 40 3F
38 44 44 44 38
7C 08 04 04 08
00 41 7F 40 00
38 44 44 48 7F
5
14 08 3E 08 14
04 02 01 02 04
40 40 40 40 40
04 02 01 02 04
14 08 3E 08 14
Case 1: # # ## ## # # ## #
# # # # # # # #
# # ### # # ### # # ### # ## # ## #
##### # # # # # # # # # # # ## # # # ##
# # ##### # # # # # # # # # # # # #
# # # # # # # # # # # # # # # #
# # ### ### ### ### # # ### # ### #### Case 2: # #
# # # # # #
# # # # # # # # # #
### ###
# # # # # #
# #
#####
题意:前面基本上都是废话,主要是让你自己看输入输出找规律。
题解:坑人的地方是这题输出的时候事实上是7行,而不是8行!!!因此PE了N次!
#include <stdio.h>
#define maxn 482 char map[8][maxn];
bool isPrint[8]; void getIsPrint(int n)
{
for(int i = 0; i < 7; ++i){
isPrint[i] = n & 1;
n >>= 1;
}
} int main()
{
//freopen("stdout.txt", "w", stdout);
int t, n, arr[5], i, j, id, k, cas = 1;
scanf("%d", &t);
while(t--){
scanf("%d", &n);
for(i = id = 0; i < n; ++i){
for(j = 0; j < 5; ++j, ++id){
scanf("%X", arr + j);
getIsPrint(arr[j]);
for(k = 0; k < 7; ++k)
if(isPrint[k]) map[k][id] = '#';
else map[k][id] = ' ';
}
if(i != n - 1){
for(k = 0; k < 7; ++k)
map[k][id] = ' ';
++id;
}
}
printf("Case %d:\n\n", cas++);
for(k = 0; k < 7; ++k){
map[k][id] = '\0';
printf("%s\n", map[k]);
}
printf("\n");
}
return 0;
}
HDU3257 Hello World!的更多相关文章
- hdu3257【模拟】
题意: 从案例找: 思路: 就是16进制,然后到2进制= =.就是个模拟= =.注意格式: #include <bits/stdc++.h> using namespace std; ty ...
随机推荐
- springmvc + jquery easyui实现分页显示
如有不明确的地方,戏迎增加QQ群交流:66728073 推荐一本Java学习的书:深入理解Java7 一,下载并导入jquery easyui的导 <link rel="st ...
- UVA 10581 - Partitioning for fun and profit(数论递推)
10581 - Partitioning for fun and profit 题目链接 题意:给定m, n,表示分配给n个格子,分配m个数字进去,每一个格子最少1,而且序列要是递增的,问第k个字典序 ...
- python3.4 尝试 py2exe
第一次成功将python3.4脚本生成 exe文件. 测试环境:win8.1 32位,python3.4,pyside py打包成exe的工具我所知道的有三种 cx-freeze , py2exe , ...
- SmartGit 试用过期
smartgit是见过的最好用的git客户端, 要解决其试用版过期的问题,如下: 1.定位到文件夹 Windows: %APPDATA%\syntevo\SmartGit\OS X: ~/Librar ...
- github上的QT源码,必要的时候还是应该看一下,仅凭猜测很容易出错
QCoreApplication::processEvents 他处理的时候拿的是current不是qAppqApp的话,才是和主线程密切相关的 一直觉得QT源码复杂,有点怕,所以没怎么看 我也看不懂 ...
- WM_PAINT消息详解,使用InvalidateRect或InvalidateRgn函数刻意产生WM_PAINT消息(WIN7里有变化,“调整视觉效果”,将“启用桌面组合”去掉)
什么时候会触发WM_PAINT消息消息呢? 以下内容来自大名鼎鼎的<Windows程序设计(第五版)> 大多数Windows程序在WinMain中进入消息循环之前的初始化期间都要呼叫函数U ...
- debian网易163更新服务器 源
sudo vi /etc/apt/sources.list 加入如下内容即可: deb http://mirrors.163.com/debian/ jessie main non-free cont ...
- HDU4850 构造一个长度n串,它需要随机长度4子是不相同
n<=50W.(使用26快报) 构造函数:26一个.截至构建26^4不同的字符串,最长的长度26^4+3.如此之大的输出"impossble",被判重量的四维阵列. 在正向结 ...
- 编写高质量代码改善java程序的151个建议——[52-57]String !about String How to use them?
原创地址: http://www.cnblogs.com/Alandre/ (泥沙砖瓦浆木匠),须要转载的,保留下! Thanks Although the world is full of s ...
- WPF Popup 置顶问题
原文 WPF Popup 置顶问题 问题: 使用wpf的popup,当在popup中弹出MessageBox或者打开对话框的时候,popup总是置顶,并遮住MessageBox或对话框. 解决: 写如 ...