HDU 6077 Time To Get Up
Time To Get Up
2017 Multi-University Training Contest - Team 3
无脑的枚举加模拟
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
char mapp[8][22];
int shu[10][7][4]={0,1,1,0,1,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,0,1,0,0,0,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,0,0,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,1,0};//枚举数字
void tutu(int a)
{
for(int k=0; k<10; k++)
{
int kk=0;
for(int i=0; i<7; i++)
{
int ii=0;
for(int j=a; j<a+4; j++)
{
if((mapp[i][j]=='X'&&shu[k][i][j-a]==1)||(mapp[i][j]=='.'&&shu[k][i][j-a]==0))
continue;
else
{
ii=1;
break;
}
}
if(ii==1)
break;
if(ii==0&&i==6)
kk=1;
}
if(kk==1)
{
printf("%d",k);
return ;
}
}
}
int main()
{
int k;
scanf("%d",&k);
while(k--)
{
for(int i=0;i<7;i++)
scanf("%s",&mapp[i]);
tutu(0);
tutu(5);
printf(":");
tutu(12);
tutu(17);
printf("\n");
}
return 0;
}