hdu 6077 Time To Get Up

一道水题而且教练讲过 一开始就没想好 这是很尴尬的 后来想了想 然后写了写 然后就这样浪费了巨大的时间 喵呜- -

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <queue>
#include <limits.h>
#include <string.h>
#include <vector>
#include <map>
//#include <math.h>
#define LL unsigned long long
#define INF 2100000000
#define fi first
#define se second
#define lowbit(x) (x&(-x))
#define eps 5e-7
using namespace std;
const int maxn=(int)1e2 +30;
const int MOD=(int)1e9+10;
//const double PI=acos(-1.0) ;
int sgn(double x){return (x>eps)-(x<-eps);}
template<class T>inline void MAX(T &a,T b){if(a<b)a=b;}
template<class T>inline void MIN(T &a,T b){if(a>b)a=b;}

char a[8][30];
//int x[]={0,0, 1,2, 4,5, 6,6, 5,4, 2,1, 3,3};
//int y[]={1,2, 3,3, 3,3, 1,2, 0,0, 0,0, 1,2};

int x[]={0, 1, 4, 6, 5, 2, 3};
int y[]={1, 3, 3, 1, 0, 0, 1};
int gethash(int n,int m){
    int ha=0;
    for(int i=0;i<7;i++){
            ha=ha<<1;
        if(a[n+x[i]][m+y[i]]=='X'){
            a[n+x[i]][m+y[i]]='Q';

            ha|=1;
        }

    }
    return ha;
}
int x1[]={0,0,0,0};
int y1[]={0,5,12,17};
int ans[5];
int fuck[]={126,48,109,121,51,91,95,112,127,123};
void out(int ha){
    int w[10];
    memset(w,0,sizeof w);
    int cnt=0;
    while(ha){
        w[cnt++]=ha&1;
        ha>>=1;
    }
    for(int i=0;i<7;i++)printf("%d",w[i]);printf("\n");
}
int main(){
#ifdef shuaishuai
    freopen("C:\\Users\\hasee\\Desktop\\a.txt","r",stdin);
    //freopen("C:\\Users\\hasee\\Desktop\\b.txt","w",stdout);
#endif
    int t;
    scanf("%d\n",&t);
    while(t--){
        for(int i=0;i<7;i++){
            gets(a[i]);
        }

        for(int i=0;i<4;i++){
            int ha=gethash(x1[i],y1[i]);
//            printf("%d %d\n",i,ha);
//            out(ha);
            ans[i]=-1;
            for(int j=0;j<10;j++){
                if(fuck[j]==ha) {ans[i]=j;break;}
            }
        }
//        for(int i=0;i<7;i++)puts(a[i]);
        printf("%d%d:%d%d\n",ans[0],ans[1],ans[2],ans[3]);
    }

    return 0;
}

 

posted @ 2017-08-04 10:00  MeowMeowMeow  阅读(253)  评论(0编辑  收藏  举报