# Poj Solution 2585

```http://poj.org/problem?id=2585

//* @author: 82638882@163.com
import java.io.*;
public class Main
{
static int[][] map=new int;
static int[][]    p=new int;
public static void main(String[] args)throws IOException
{
while(true)
{
if(s.equals("ENDOFINPUT"))break;
String[] ss;
for(int i=0;i< 4;i++)
{
for(int j=0;j< 4;j++)
p[i][j]=Integer.parseInt(ss[j]);
}
for(int i=1;i< 10;i++)
for(int j=1;j< 10;j++)
map[i][j]=0;
f();
for(int i=1;i< 10;i++)
map[i][i]=0;
while(true)
{
boolean qq=false;
for(int i=1;i< 10;i++)
for(int j=1;j< 10;j++)
for(int k=1;k< 10;k++)
if(map[i][j]==1&&map[j][k]==1&&map[i][k]==0)
{
map[i][k]=1;
qq=true;
}
if(!qq)break;
}
boolean bb=true;
for(int i=1;i< 10;i++)
if(map[i][i]==1){
bb=false;
break;
}
if(bb) System.out.println("THESE WINDOWS ARE CLEAN");
else System.out.println("THESE WINDOWS ARE BROKEN");
}
}

static void f()
{
int x;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
map[x]=1;
map[x]=1;
x=p;
map[x]=1;
map[x]=1;
map[x]=1;
map[x]=1;
}
}
```
This entry was posted in poj. Bookmark the permalink.