hdu 2487 Ugly Windows 模拟
标签:style blog color os for io
#include
#include
#include
#include using namespace std;
char map[110][110];
int n,m;
#define inf 100000
struct node
{
int x,y;
};
vector nn;
int main()
{
while(1)
{
int i,j,k;
scanf("%d%d",&n,&m);
if(n==0) break;
getchar();
for(i=1;i)
{
for(j=1;j)
scanf("%c",&map[i][j]);
getchar();
}
for(k=0;k26;k++)
{
nn.clear();
int maxx=0,maxy=0,minx=inf,miny=inf;
char x=‘A‘+k;
int flag=1;
for(i=1;i)
for(j=1;j)
if(map[i][j]==x)
{
node tmp;
tmp.x=i;
tmp.y=j;
nn.push_back(tmp);
}
for(i=0;i)
{
if(nn[i].x>maxx) maxx=nn[i].x;
if(nn[i].xnn[i].x;
if(nn[i].y>maxy) maxy=nn[i].y;
if(nn[i].ynn[i].y;
}
if(maxx2) continue;//printf("aaa");
if(maxy2) continue;
if(nn.size()!=(maxx-minx+maxy-miny)*2) flag=0;
for(i=minx+1;i)
for(j=miny+1;j)
if(isupper(map[i][j]))
{
flag=0;
break;
}
if(flag) printf("%c",x);
}
printf("\n");
}
return 0;
}
hdu 2487 Ugly Windows 模拟,搜素材,soscw.com
hdu 2487 Ugly Windows 模拟
标签:style blog color os for io
原文地址:http://www.cnblogs.com/vermouth/p/3839939.html
评论