【2017 Multi-University Training Contest - Team 4】Time To Get Up
【Link】:
【Description】
【Solution】
把每个数字长什么样存到数组里就好;傻逼题。
(直接输入每一行是什么样子更快,不要一个字符一个字符地输入)
【NumberOf WA】
1
【Reviw】
【Code】
#include <bits/stdc++.h>
using namespace std;
int T;
char s[10][30];
char temp[10][10][7];
int get_ans(int x1,int y1,int x2,int y2){
for (int k = 0;k <= 9;k++){
bool ok = true;
for (int i = x1;i <= x2;i++)
for (int j = y1;j <= y2;j++){
if (temp[k][i-x1+1][j-y1+1]!=s[i][j])
ok = false;
}
if (ok) return k;
}
return 2333;
}
int main(){
for (int k = 0;k <= 9;k++)
for (int i = 1;i <= 7;i++)
for (int j = 1;j <= 4;j++)
temp[k][i][j] = '.';
//'0';
for (int i = 2;i <= 3;i++)
temp[0][1][i] = temp[0][7][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[0][i][1] = temp[0][i][4] = 'X';
for (int i = 5;i <= 6;i++)
temp[0][i][1] = temp[0][i][4] = 'X';
//'1';
for (int i = 2;i <= 3;i++)
temp[1][i][4] = 'X';
for (int i = 5;i <= 6;i++)
temp[1][i][4] = 'X';
//'2'
for (int i = 2;i <= 3;i++)
temp[2][1][i] = temp[2][4][i] = temp[2][7][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[2][i][4] = 'X';
for (int i = 5;i <= 6;i++)
temp[2][i][1] = 'X';
//'3'
for (int i = 2;i <= 3;i++)
temp[3][1][i] = temp[3][4][i] = temp[3][7][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[3][i][4] = 'X';
for (int i = 5;i <= 6;i++)
temp[3][i][4] = 'X';
//'4'
for (int i = 2;i <= 3;i++)
temp[4][i][1] = temp[4][i][4] = 'X';
for (int i = 2;i <= 3;i++)
temp[4][4][i] = 'X';
for (int i = 5;i <= 6;i++)
temp[4][i][4] = 'X';
//'5'
for (int i = 2;i <= 3;i++)
temp[5][1][i] = temp[5][4][i] = temp[5][7][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[5][i][1] = 'X';
for (int i = 5;i <= 6;i++)
temp[5][i][4] = 'X';
//'6'
for (int i = 2;i <= 3;i++)
temp[6][1][i] = temp[6][4][i] = temp[6][7][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[6][i][1] = 'X';
for (int i = 5;i <= 6;i++)
temp[6][i][1] = temp[6][i][4] = 'X';
//'7'
for (int i = 2;i <= 3;i++)
temp[7][1][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[7][i][4] = 'X';
for (int i = 5;i <= 6;i++)
temp[7][i][4] = 'X';
//8
for (int i = 2;i <= 3;i++)
temp[8][1][i] = temp[8][4][i] = temp[8][7][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[8][i][1] = temp[8][i][4] = 'X';
for (int i = 5;i <= 6;i++)
temp[8][i][1] = temp[8][i][4] = 'X';
//9
for (int i = 2;i <= 3;i++)
temp[9][1][i] = temp[9][4][i] = temp[9][7][i] = 'X';
for (int i = 2;i <= 3;i++)
temp[9][i][1] = temp[9][i][4] = 'X';
for (int i = 5;i <= 6;i++)
temp[9][i][4] = 'X';
//freopen("F:\\rush.txt","r",stdin);
scanf("%d",&T);
while (T--){
for (int i = 1;i <= 7;i++)
scanf("%s",s[i]+1);
int a = get_ans(1,1,7,4),b = get_ans(1,6,7,9);
int c = get_ans(1,13,7,16),d = get_ans(1,18,7,21);
printf("%d%d:%d%d\n",a,b,c,d);
}
return 0;
}
【2017 Multi-University Training Contest - Team 4】Time To Get Up的更多相关文章
- 【2017 Multi-University Training Contest - Team 2】TrickGCD
[Link]:http://acm.hdu.edu.cn/showproblem.php?pid=6053 [Description] 给你一个b数组,让你求一个a数组: 要求,该数组的每一位都小于等 ...
- 【2017 Multi-University Training Contest - Team 2】Maximum Sequence
[Link]:http://acm.hdu.edu.cn/showproblem.php?pid=6047 [Description] 给你一个数列a和一个数列b; 只告诉你a的前n项各是什么; 然后 ...
- 【2017 Multi-University Training Contest - Team 2】 Regular polygon
[Link]: [Description] 给你n个点整数点; 问你这n个点,能够组成多少个正多边形 [Solution] 整点只能构成正四边形. 则先把所有的边预处理出来; 枚举每某两条边为对角线的 ...
- 【2017 Multi-University Training Contest - Team 2】 Is Derek lying?
[Link]: [Description] 两个人都做了完全一样的n道选择题,每道题都只有'A','B','C' 三个选项,,每道题答对的话得1分,答错不得分也不扣分,告诉你两个人全部n道题各自选的是 ...
- 【2017 Multi-University Training Contest - Team 5】Rikka with Competition
[Link]: [Description] [Solution] 把所有人的能力从大到小排; 能力最大的肯定可能拿冠军; 然后一个一个地往后扫描; 一旦出现a[i-1]-a[i]>k; 则说明从 ...
- 【2017 Multi-University Training Contest - Team 5】Rikka with Subset
[Link]: [Description] 给你a数组的n个数的所有2^n个子集的2^n个子集元素的和; 子集元素的和最大为m; 告诉你各个子集元素的和出现的次数; 如 1 2 则0出现1次,1出现1 ...
- 【2017 Multi-University Training Contest - Team 5】Rikka with Graph
[Link]:http://acm.hdu.edu.cn/showproblem.php?pid=6090 [Description] 给你n个点; 让你在这n个点上最多连m条无向边; 使得 ∑ni= ...
- 【2017 Multi-University Training Contest - Team 4】Counting Divisors
[Link]:http://acm.hdu.edu.cn/showproblem.php?pid=6069 [Description] 定义d(i)为数字i的因子个数; 求∑rld(ik) 其中l,r ...
- 【2017 Multi-University Training Contest - Team 3】RXD and math
[Link]: [Description] [Solution] 发现1010mod(109+7)=999999937; 猜测答案是nk 写个快速幂; 注意对底数先取模; [NumberOf WA] ...
随机推荐
- django-debug-toolbar 使用
https://pypi.org/project/django-debug-toolbar/ https://django-debug-toolbar.readthedocs.io/en/latest ...
- HDU 4941 Magical Forest (Hash)
这个题比赛的时候是乱搞的,比赛结束之后学长说是映射+hash才恍然大悟.因此决定好好学一下hash. 题意: M*N的格子,里面有一些格子里面有一个值. 有三种操作: 1.交换两行的值. 2.交换两列 ...
- HDU 4939 Stupid Tower Defense 简单DP
题意: 地图为长为n个单位长度的直线,每通过一个单位长度需要t秒. 有3种塔,红塔可以在当前格子每秒造成x点伤害,绿塔可以在之后格子造成y点伤害,蓝塔可以使通过单位长度的时间增加z秒. 让你安排塔的排 ...
- POJ 2241 The Tower of Babylon
The Tower of Babylon Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged on PKU. Or ...
- ArcGIS api for javascript——地图配置-定制缩放动画,定制缩放框
描述 本例展示了当用户放大或缩小地图时如何定义地图的动画.zoomDuration和zoomRate是Dojo动画属性,他们确定了动画的duration和帧刷新的rate .这些属性单位是毫秒,zoo ...
- bzoj1066【SCOI2007】蜥蜴
1066: [SCOI2007]蜥蜴 Time Limit: 1 Sec Memory Limit: 162 MB Submit: 2512 Solved: 1238 [Submit][Statu ...
- 惊叹计算机运行速度的提升---以n Queens 问题为例
1 介绍 实现了书<Data Structures and Program design in C++>(Robert L. Kruse and Alexander J. Ryba, 20 ...
- Java 8 时间日期库的20个使用演示样例
除了lambda表达式,stream以及几个小的改进之外,Java 8还引入了一套全新的时间日期API,在本篇教程中我们将通过几个简单的任务演示样例来学习怎样使用Java 8的这套API.Java对日 ...
- base64格式的图片数据如何转成图片
base64格式的图片数据如何转成图片 一.总结 一句话总结:不仅要去掉前面的格式串,还需要base64_decode()解码才行. // $base_img是获取到前端传递的值 $base_img ...
- 4.graph.h
#pragma once #include <stdio.h> #include <graphics.h> #include <mmsystem.h> #pragm ...