【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;
}

转载于:https://www.cnblogs.com/AWCXV/p/7626138.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值