Hello World!

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 465    Accepted Submission(s): 172
Problem Description
Your task is to print ... er ... "Hello World" ... in a fantastic way -- using a beautiful font.



I've sent you a nice font for you to use, but I'm too busy to tell you how. Can you help yourself?
 
Input
The first line contains a single integer T (T <= 20), the number of test cases.


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...
 
Output
For each test case, print the case number in the first line, then followed by a blank line.

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.
 
Sample Input
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
 
Sample Output
Case 1: # # ## ## # # ## #
# # # # # # # #
# # ### # # ### # # ### # ## # ## #
##### # # # # # # # # # # # ## # # # ##
# # ##### # # # # # # # # # # # # #
# # # # # # # # # # # # # # # #
# # ### ### ### ### # # ### # ### #### Case 2: # #
# # # # # #
# # # # # # # # # #
### ###
# # # # # #
# #
#####
 
Source

题意:前面基本上都是废话,主要是让你自己看输入输出找规律。

题解:坑人的地方是这题输出的时候事实上是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!的更多相关文章

  1. hdu3257【模拟】

    题意: 从案例找: 思路: 就是16进制,然后到2进制= =.就是个模拟= =.注意格式: #include <bits/stdc++.h> using namespace std; ty ...

随机推荐

  1. IP数据报首部校验和算法

    当用google搜索IP数据报首部校验和算法的时候,总是看到的是代码,没有看到其过程,于是就有了此文,如有错误请指正.文章省略一点,呵呵   IP/ICMP/IGMP/TCP/UDP等协议的校验和算法 ...

  2. UML01-概述

    1.UML中的泛化关系用什么符号表示? 2.UML的英文全称是什么? 3.UML图不包括流程图. 4.对一个重要的系统有时要用多个模型就才能充分描述.

  3. javascript笔记整理(概述,变量,数据类型)

    A.概述 1.输出工具: document.write()---可以是html alert()---字符串 prompt(text,defaultText) text---可选.要在对话框中显示的纯文 ...

  4. EF架构使用随机排序

    c#当中,可以用Random类来获取随机数 EF当中,我们写Linq时,抑或是采用Linq的扩展方法时,发现都没有随机排序的方法,这就要求我们自己去扩展了 引用自http://www.cnblogs. ...

  5. 用 Asterisk 搭建自己的免费 VoIP 服务器

    原文 http://www.yaoblog.info/?p=5021 1. 这里以 Debian 为例子,安装 Asterisk apt-get update apt-get install aste ...

  6. jquery 如何动态添加、删除class样式方法介绍

    获取与设置样式 获取class和设置class都可以使用attr()方法来完成.例如使用attr()方法来获取p元素的class 取与设置样式 获取class和设置class都可以使用attr()方法 ...

  7. Spring注入静态变量(转)

    今天碰到一个问题,我的一个工具类提供了几种静态方法,静态方法需要另外一个类的实例提供处理,因此就写出了这样的代码: Class Util{ private static XXX xxx; xxx = ...

  8. Javascript 调试利器 Firebug使用详解

    Javascript 调试利器 Firebug使用详解 有时候,为了更清楚方便的查看输出信息,我们可能需要将一些调试信息进行分组输出,那么可以使用console.group来对信息进行分组,在组信息输 ...

  9. Java--Eclipse关联Java源码

    打开Eclipse,Window->Preferences->Java 点Edit按钮后弹出: 点Source Attachment后弹出: 选择Java安装路径下的src.zip文件即可 ...

  10. mysql数据导出权限问题

    mysql数据导出的方法有非常多,比如mysqldump, mysql -e 'sql' > file, 这些都能够非常方便的导出数据,但是在使用普通用户导出数据的时候,出现了问题. 1 sel ...