hdu 多校联赛 Time To Get Up
来源:互联网 发布:大数据板块龙头股票 编辑:程序博客网 时间:2024/06/05 00:13
Time To Get Up
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0
Problem Description
Little Q's clock is alarming! It's time to get up now! However, after reading the time on the clock, Little Q lies down and starts sleeping again. Well, he has 5 alarms, and it's just the first one, he can continue sleeping for a while.
Little Q's clock uses a standard 7-segment LCD display for all digits, plus two small segments for the '':'', and shows all times in a 24-hour format. The '':'' segments are on at all times.
Your job is to help Little Q read the time shown on his clock.
Little Q's clock uses a standard 7-segment LCD display for all digits, plus two small segments for the '':'', and shows all times in a 24-hour format. The '':'' segments are on at all times.
Your job is to help Little Q read the time shown on his clock.
Input
The first line of the input contains an integer T(1≤T≤1440) , denoting the number of test cases.
In each test case, there is an7×21 ASCII image of the clock screen.
All digit segments are represented by two characters, and each colon segment is represented by one character. The character ''X'' indicates a segment that is on while ''.'' indicates anything else. See the sample input for details.
In each test case, there is an
All digit segments are represented by two characters, and each colon segment is represented by one character. The character ''X'' indicates a segment that is on while ''.'' indicates anything else. See the sample input for details.
Output
For each test case, print a single line containing a string t in the format of HH:MM , where t(00:00≤t≤23:59) , denoting the time shown on the clock.
Sample Input
1.XX...XX.....XX...XX.X..X....X......X.X..XX..X....X.X....X.X..X......XX.....XX...XX.X..X.X....X....X.X..XX..X.X.........X.X..X.XX...XX.....XX...XX.
Sample Output
02:38题意:看图说数、题目并不难 大多数参赛的队伍都做出来了 就是一个简单看图说数 可是我还是因为格式问题错了好几次。ac代码(代码可能写的有点麻烦 但易于理解):#include<bits/stdc++.h>using namespace std;#define maxn 10#define maxm 24char p[maxn][maxm];//开一个矩阵列表 用于存储图int main(){ int t; int a,b,c,d; scanf("%d",&t); int i=0; int h=t; while(t--) { i++; memset(p,0,sizeof(p)); if(t==h-1) getchar(); a=0,b=0,c=0,d=0; for(int i = 1; i<=7;i++) { for(int j=1;j<=21;j++) scanf("%c",&p[i][j]);//读入图 if(i!=7) getchar();//坑在这里 最后一行的输入不能再让getchar吃掉回车 否则第二张图读的时候会出错 } if(p[1][2]=='.')//判断第一个字 a=1; else if(p[2][1]=='.') a=2; else if(p[4][2]=='.'&&p[1][4]=='X') a=0; /*---------------------*///判断第三个字 if(p[2][16]=='.') c=5; else if(p[5][16]=='.') c=2; else if(p[1][14]=='.'&&p[2][13]=='X') c=4; else if(p[7][14]=='.') c=1; else if(p[4][14]=='.') c=0; else if(p[4][14]=='X'&&p[2][13]=='.') c=3; /*---------------------*///判断第二个字 if(p[2][9]=='.'&&p[5][6]=='.') b=5; else if(p[2][9]=='.'&&p[5][6]=='X') b=6; else if(p[1][7]=='.'&&p[4][7]=='.') b=1; else if(p[1][7]=='.'&&p[4][7]=='X') b=4; else if(p[7][7]=='.') b=7; else if(p[4][7]=='.') b=0; else if(p[5][9]=='.') b=2; else if(p[2][6]=='.'&&p[5][6]=='.') b=3; else if(p[5][6]=='.') b=9; else if (p[2][6]=='X'&&p[5][6]=='X') b=8; /*-----------------------*///判断第四个字 if(p[2][21]=='.'&&p[5][18]=='.') d=5; else if(p[2][21]=='.'&&p[5][18]=='X') d=6; else if(p[1][19]=='.'&&p[4][19]=='.') d=1; else if(p[1][19]=='.'&&p[4][19]=='X') d=4; else if(p[7][19]=='.') d=7; else if(p[4][19]=='.') d=0; else if(p[5][21]=='.') d=2; else if(p[2][18]=='.'&&p[5][18]=='.') d=3; else if(p[5][18]=='.') d=9; else if (p[2][18]=='X'&&p[5][18]=='X') d=8; printf("%d%d:%d%d\n",a,b,c,d); getchar();//吃掉回车 防止影响下次的读入 } return 0;}
阅读全文
0 0
- hdu 多校联赛 Time To Get Up
- HDU6077 Time To Get Up(模拟,2017 HDU多校联赛 第4场)
- HDU 2017 多校联赛4 1011 Time To Get Up
- 17暑假多校联赛4.11 HDU 6077 Time To Get Up
- Time To Get Up HDU
- HDU6077 2017杭电多校联赛第四场-Time To Get Up
- 【多校训练】hdu 6077 Time To Get Up
- hdu-暑假集训-Time To Get Up
- hdu 6077-Time To Get Up
- HDU 6077 Time To Get Up 模拟
- HDU 6077 Time To Get Up【】
- HDU 6077 Time To Get Up
- hdu 6077 Time To Get Up【暴力】
- hdu 6077 Time To Get Up
- hdu--6077 Time To Get Up
- Time To Get Up
- Time To Get Up
- Time To Get Up
- hdu3667 最小费用流 拆边题
- Angular 组件间通信
- 有符号数据的符号位扩展
- POJ 1442 Black Box treap || 树状数组 || 优先队列
- #Java was started but returned exit code=13.....
- hdu 多校联赛 Time To Get Up
- Springboot logback日志配置
- char *转VARIANT
- 【视频开发】非常优秀的CxImage各种格式图像开源工具
- HDU
- HDU-6059 Kanade's trio(字典树)
- web.xml is missing and <failOnMissingWebXml> is set to true
- js 常用对象
- 二维凸包 Graham扫描算法 +hdu 1392