QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#545801#4365. Clock BreakingPhantomThreshold#AC ✓30ms3864kbC++204.6kb2024-09-03 17:22:322024-09-03 17:22:34

Judging History

你现在查看的是最新测评结果

  • [2024-09-03 17:22:34]
  • 评测
  • 测评结果:AC
  • 用时:30ms
  • 内存:3864kb
  • [2024-09-03 17:22:32]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

char digit[10][7][5]={
    {
        ".XX.",
        "X..X",
        "X..X",
        "....",
        "X..X",
        "X..X",
        ".XX."
    },
    {
        "....",
        "...X",
        "...X",
        "....",
        "...X",
        "...X",
        "...."
    },
    {
        ".XX.",
        "...X",
        "...X",
        ".XX.",
        "X...",
        "X...",
        ".XX."
    },
    {
        ".XX.",
        "...X",
        "...X",
        ".XX.",
        "...X",
        "...X",
        ".XX."
    },
    {
        "....",
        "X..X",
        "X..X",
        ".XX.",
        "...X",
        "...X",
        "...."
    },
    {
        ".XX.",
        "X...",
        "X...",
        ".XX.",
        "...X",
        "...X",
        ".XX."
    },
    {
        ".XX.",
        "X...",
        "X...",
        ".XX.",
        "X..X",
        "X..X",
        ".XX."
    },
    {
        ".XX.",
        "...X",
        "...X",
        "....",
        "...X",
        "...X",
        "...."
    },
    {
        ".XX.",
        "X..X",
        "X..X",
        ".XX.",
        "X..X",
        "X..X",
        ".XX."
    },
    {
        ".XX.",
        "X..X",
        "X..X",
        ".XX.",
        "...X",
        "...X",
        ".XX."
    },
};

const int maxt=24*60;
int n;
char a[105][10][25];

int ok[10][25][3];

bool all0[10][25];
bool all1[10][25];
bool alleq[10][25];

char target[10][25];

bool check(int st){
    for (int i=0;i<7;i++){
        for (int j=0;j<21;j++){
            all0[i][j]=1;
            all1[i][j]=1;
            alleq[i][j]=1;
        }
    }
    for (int len=0;len<n;len++){
        int nowt=(st+len)%maxt;
        int h=nowt/60;
        int mi=nowt%60;

        int A=h/10;
        int B=h%10;
        int C=mi/10;
        int D=mi%10;

        for (int i=0;i<7;i++)
            for (int j=0;j<21;j++) target[i][j]='.';
		if (A!=0){
        	for (int i=0;i<7;i++){
            	for (int j=0;j<4;j++){
                	target[i][j]=digit[A][i][j];
            	}
        	}
		}
        for (int i=0;i<7;i++){
            for (int j=0;j<4;j++){
                target[i][j+5]=digit[B][i][j];
            }
        }
        target[2][10]='X';
        target[4][10]='X';
        for (int i=0;i<7;i++){
            for (int j=0;j<4;j++){
                target[i][j+12]=digit[C][i][j];
            }
        }
        for (int i=0;i<7;i++){
            for (int j=0;j<4;j++){
                target[i][j+17]=digit[D][i][j];
            }
        }
        for (int i=0;i<7;i++){
            for (int j=0;j<21;j++){
                if (a[len][i][j]!='.') all0[i][j]=0;
                if (a[len][i][j]!='X') all1[i][j]=0;
                if (a[len][i][j]!=target[i][j]) alleq[i][j]=0;
            }
        }
		// if (st==58){
		// 	cerr << "len : " << len << endl;
		// 	for (int i=0;i<7;i++){
		// 		for (int j=0;j<21;j++){
		// 			cerr << target[i][j];
		// 		}
		// 		cerr << endl;
		// 	}
		// 	cerr << endl;
		// }
    }
    for (int i=0;i<7;i++){
        for (int j=0;j<21;j++){
            if (!all0[i][j] && !all1[i][j] && !alleq[i][j]) return false;
        }
    }
    for (int i=0;i<7;i++){
        for (int j=0;j<21;j++){
            ok[i][j][0]+=all0[i][j];
            ok[i][j][1]+=all1[i][j];
            ok[i][j][2]+=alleq[i][j];
        }
    }
    return true;
}

char vis[7][22]={
	".XX...XX.....XX...XX.",
	"X..X.X..X...X..X.X..X",
	"X..X.X..X.X.X..X.X..X",
	".XX...XX.....XX...XX.",
	"X..X.X..X.X.X..X.X..X",
	"X..X.X..X...X..X.X..X",
	".XX...XX.....XX...XX.",
};

int main(){
    ios_base::sync_with_stdio(false);
    cin >> n;
    for (int i=0;i<n;i++){
        string str;
        for (int j=0;j<7;j++){
            cin >> str;
            for (int k=0;k<21;k++) a[i][j][k]=str[k];
        }
    }
    int cnt=0;
    for (int tm=0;tm<maxt;tm++){
        if (check(tm)){
			cnt++;
			// cerr << "tm : " << endl;
			// cerr << "h,mi : " << tm/60 << " " << tm%60 << endl;
		}
    }
    if (cnt==0){
        cout << "impossible" << "\n";
        return 0;
    }
	for (int i=0;i<7;i++){
		for (int j=0;j<21;j++){
			if (vis[i][j]=='.'){
				cout << ".";
				continue;
			}
			int cc=0;
			if (ok[i][j][0]>0) cc++;
			if (ok[i][j][1]>0) cc++;
			if (ok[i][j][2]>0) cc++;
			if (cc!=1) cout << "?";
			else{
				if (ok[i][j][0]>0) cout << "0";
				else if (ok[i][j][1]>0) cout << "1";
				else if (ok[i][j][2]>0) cout << "W";
			}
		}
		cout << "\n";
	}
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3776kb

input:

3
......XX.....XX...XX.
.....X..X...X..X....X
.....X..X.X.X..X....X
.............XX...XX.
.....X..X......X.X..X
.....X..X......X.X..X
......XX.....XX...XX.

......XX.....XX...XX.
.....X..X...X..X....X
.....X..X.X.X..X....X
.............XX...XX.
.....X..X......X.X..X
.....X..X......X.X..X
......XX......

output:

.??...WW.....??...??.
?..?.W..?...?..1.0..?
?..?.W..?.?.?..1.0..?
.??...??.....11...WW.
?..?.W..?.0.W..?.1..?
?..?.W..?...W..?.1..?
.??...11.....??...??.

result:

ok 7 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

2
......XX.....XX...XX.
...X....X...X..X.X..X
...X....X.X.X..X.X..X
......XX..........XX.
...X.X....X.X..X.X..X
...X.X......X..X.X..X
......XX.....XX...XX.

......XX.....XX......
...X....X...X..X.....
...X....X.X.X..X.....
......XX.............
...X.X....X.X..X.....
...X.X......X..X.....
......XX......

output:

impossible

result:

ok single line: 'impossible'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

3
.XX...XX.....XX...XX.
...X.X..X...X..X....X
...X.X..X.X.X..X....X
.XX..........XX...XX.
X....X..X......X.X..X
X....X..X......X.X..X
.XX...XX.....XX...XX.

.XX...XX.....XX...XX.
...X.X..X...X..X....X
...X.X..X.X.X..X....X
.XX..........XX...XX.
X....X..X......X.X..X
X....X..X......X.X..X
.XX...XX......

output:

.??...WW.....??...??.
?..?.W..?...?..1.0..?
?..?.W..?.?.?..1.0..?
.??...??.....11...WW.
?..?.W..?.0.W..?.1..?
?..?.W..?...W..?.1..?
.??...11.....??...??.

result:

ok 7 lines

Test #4:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

2
.....................
.....................
..........X..........
.....................
.....................
.....................
.....................

.....................
.....................
.....................
.....................
.....................
.....................
..............

output:

impossible

result:

ok single line: 'impossible'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

1
.....................
.....................
..........X..........
.....................
..........X..........
.....................
.....................

output:

.??...??.....??...??.
?..?.?..?...?..?.?..?
?..?.?..?.?.?..?.?..?
.??...??.....??...??.
?..?.?..?.?.?..?.?..?
?..?.?..?...?..?.?..?
.??...??.....??...??.

result:

ok 7 lines

Test #6:

score: 0
Accepted
time: 1ms
memory: 3496kb

input:

3
.....................
.....................
..........X..........
.....................
..........X..........
.....................
.....................

.....................
.....................
..........X..........
.....................
..........X..........
.....................
..............

output:

.??...??.....??...00.
?..?.?..?...?..?.?..0
?..?.?..?.?.?..?.?..0
.??...??.....??...00.
?..?.?..?.?.?..?.?..0
?..?.?..?...?..?.?..0
.??...??.....??...00.

result:

ok 7 lines

Test #7:

score: 0
Accepted
time: 3ms
memory: 3848kb

input:

10
.....................
.....................
..........X..........
.....................
..........X..........
.....................
.....................

.....................
.....................
..........X..........
.....................
..........X..........
.....................
.............

output:

.??...??.....??...00.
?..?.?..?...?..?.0..0
?..?.?..?.?.?..?.0..0
.??...??.....??...00.
?..?.?..?.?.?..?.0..0
?..?.?..?...?..?.0..0
.??...??.....??...00.

result:

ok 7 lines

Test #8:

score: 0
Accepted
time: 3ms
memory: 3856kb

input:

25
.....................
.....................
..........X..........
.....................
..........X..........
.....................
.....................

.....................
.....................
..........X..........
.....................
..........X..........
.....................
.............

output:

.??...??.....00...00.
?..?.?..?...?..0.0..0
?..?.?..?.?.?..0.0..0
.??...??.....00...00.
?..?.?..?.?.?..0.0..0
?..?.?..?...?..0.0..0
.??...??.....00...00.

result:

ok 7 lines

Test #9:

score: 0
Accepted
time: 12ms
memory: 3828kb

input:

50
.....................
.....................
..........X..........
.....................
..........X..........
.....................
.....................

.....................
.....................
..........X..........
.....................
..........X..........
.....................
.............

output:

.??...??.....00...00.
?..?.?..?...0..0.0..0
?..?.?..?.?.0..0.0..0
.??...??.....00...00.
?..?.?..?.?.0..0.0..0
?..?.?..?...0..0.0..0
.??...??.....00...00.

result:

ok 7 lines

Test #10:

score: 0
Accepted
time: 20ms
memory: 3636kb

input:

100
.....................
.....................
..........X..........
.....................
..........X..........
.....................
.....................

.....................
.....................
..........X..........
.....................
..........X..........
.....................
............

output:

.??...00.....00...00.
?..?.?..?...0..0.0..0
?..?.?..?.?.0..0.0..0
.??...??.....00...00.
?..?.?..0.?.0..0.0..0
?..?.?..0...0..0.0..0
.??...00.....00...00.

result:

ok 7 lines

Test #11:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

1
.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....XX...XX.

output:

.??...??.....??...??.
1..?.?..?...?..?.?..?
1..?.?..?.?.?..?.?..?
.??...??.....??...??.
?..?.?..?.?.?..?.?..?
?..?.?..?...?..?.?..?
.??...??.....??...??.

result:

ok 7 lines

Test #12:

score: 0
Accepted
time: 2ms
memory: 3656kb

input:

3
.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....XX...XX.

.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX......

output:

.??...??.....??...??.
1..?.?..?...?..?.?..?
1..?.?..?.?.?..?.?..?
.??...??.....??...??.
?..?.?..?.?.?..?.1..?
?..?.?..?...?..?.1..?
.??...??.....??...??.

result:

ok 7 lines

Test #13:

score: 0
Accepted
time: 4ms
memory: 3812kb

input:

10
.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....XX...XX.

.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....

output:

.??...??.....??...11.
1..?.?..?...?..?.1..1
1..?.?..?.?.?..?.1..1
.??...??.....??...11.
?..?.?..?.?.?..?.1..1
?..?.?..?...?..?.1..1
.??...??.....??...11.

result:

ok 7 lines

Test #14:

score: 0
Accepted
time: 8ms
memory: 3856kb

input:

25
.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....XX...XX.

.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....

output:

.??...??.....11...11.
1..?.?..?...?..?.1..1
1..?.?..?.?.?..?.1..1
.??...??.....??...11.
?..?.?..?.?.1..?.1..1
?..?.?..?...1..?.1..1
.??...??.....11...11.

result:

ok 7 lines

Test #15:

score: 0
Accepted
time: 11ms
memory: 3864kb

input:

50
.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....XX...XX.

.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....

output:

.??...??.....11...11.
1..?.?..?...1..?.1..1
1..?.?..?.?.1..?.1..1
.??...??.....11...11.
?..?.?..?.?.1..?.1..1
?..?.?..?...1..?.1..1
.??...??.....11...11.

result:

ok 7 lines

Test #16:

score: 0
Accepted
time: 30ms
memory: 3652kb

input:

100
.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX.....XX...XX.

.XX...XX.....XX...XX.
X..X.X..X...X..X.X..X
X..X.X..X.X.X..X.X..X
.XX...XX.....XX...XX.
X..X.X..X.X.X..X.X..X
X..X.X..X...X..X.X..X
.XX...XX....

output:

.??...??.....11...11.
1..?.?..?...1..1.1..1
1..?.?..?.?.1..1.1..1
.??...??.....11...11.
?..?.1..?.?.1..1.1..1
?..?.1..?...1..1.1..1
.??...??.....11...11.

result:

ok 7 lines

Test #17:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

2
.....................
.....................
.....................
.....................
.....................
.....................
.....................

..................XX.
.....................
.....................
.....................
.....................
.....................
..............

output:

.??...??.....??...WW.
?..?.?..?...?..?.?..0
?..?.?..?.0.?..?.?..0
.??...??.....??...00.
?..?.?..?.0.?..?.?..0
?..?.?..?...?..?.?..0
.??...??.....??...00.

result:

ok 7 lines

Test #18:

score: 0
Accepted
time: 1ms
memory: 3552kb

input:

3
.....................
.....................
.....................
.....................
.....................
.....................
.....................

..................XX.
.....................
.....................
.....................
.....................
.....................
..............

output:

impossible

result:

ok single line: 'impossible'

Test #19:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

2
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
....................X
....................X
.....................
.....................
.....................
..............

output:

.??...??.....??...00.
?..?.?..?...?..?.0..W
?..?.?..?.0.?..?.0..W
.??...??.....??...00.
?..?.?..?.0.?..?.0..0
?..?.?..?...?..?.0..0
.??...??.....??...00.

result:

ok 7 lines

Test #20:

score: 0
Accepted
time: 1ms
memory: 3776kb

input:

3
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
....................X
....................X
.....................
.....................
.....................
..............

output:

impossible

result:

ok single line: 'impossible'

Test #21:

score: 0
Accepted
time: 1ms
memory: 3776kb

input:

2
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
.....................
....................X
....................X
..............

output:

.??...??.....??...00.
?..?.?..?...?..?.?..0
?..?.?..?.0.?..?.?..0
.??...??.....??...00.
?..?.?..?.0.?..?.0..W
?..?.?..?...?..?.0..W
.??...??.....??...00.

result:

ok 7 lines

Test #22:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

3
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
.....................
....................X
....................X
..............

output:

impossible

result:

ok single line: 'impossible'

Test #23:

score: 0
Accepted
time: 1ms
memory: 3552kb

input:

2
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
.....................
.....................
.....................
..............

output:

.??...??.....??...00.
?..?.?..?...?..?.?..0
?..?.?..?.0.?..?.?..0
.??...??.....??...00.
?..?.?..?.0.?..?.?..0
?..?.?..?...?..?.?..0
.??...??.....??...WW.

result:

ok 7 lines

Test #24:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

3
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
.....................
.....................
.....................
..............

output:

impossible

result:

ok single line: 'impossible'

Test #25:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

2
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
.....................
.................X...
.................X...
..............

output:

.??...??.....??...00.
?..?.?..?...?..?.?..?
?..?.?..?.0.?..?.?..?
.??...??.....??...00.
?..?.?..?.0.?..?.W..0
?..?.?..?...?..?.W..0
.??...??.....??...00.

result:

ok 7 lines

Test #26:

score: 0
Accepted
time: 1ms
memory: 3836kb

input:

3
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
.....................
.................X...
.................X...
..............

output:

impossible

result:

ok single line: 'impossible'

Test #27:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

2
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.................X...
.................X...
.....................
.....................
.....................
..............

output:

.??...??.....??...00.
?..?.?..?...?..?.W..0
?..?.?..?.0.?..?.W..0
.??...??.....??...00.
?..?.?..?.0.?..?.?..0
?..?.?..?...?..?.?..0
.??...??.....??...00.

result:

ok 7 lines

Test #28:

score: 0
Accepted
time: 1ms
memory: 3776kb

input:

3
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.................X...
.................X...
.....................
.....................
.....................
..............

output:

impossible

result:

ok single line: 'impossible'

Test #29:

score: 0
Accepted
time: 1ms
memory: 3544kb

input:

2
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
..................XX.
.....................
.....................
..............

output:

.??...??.....??...00.
?..?.?..?...?..?.?..0
?..?.?..?.0.?..?.?..0
.??...??.....??...WW.
?..?.?..?.0.?..?.0..0
?..?.?..?...?..?.0..0
.??...??.....??...00.

result:

ok 7 lines

Test #30:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

3
.....................
.....................
.....................
.....................
.....................
.....................
.....................

.....................
.....................
.....................
..................XX.
.....................
.....................
..............

output:

impossible

result:

ok single line: 'impossible'

Test #31:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

2
.............XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.

.XX..........XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.
............X..X.X..X
............X..X.X..X
..............

output:

.WW...00.....??...??.
?..0.0..0...?..1.?..?
?..0.0..0.0.?..1.?..?
.00...00.....11...11.
0..0.0..0.0.1..?.1..?
0..0.0..0...1..?.1..?
.00...00.....??...??.

result:

ok 7 lines

Test #32:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

2
.XX..........XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.

.............XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.
............X..X.X..X
............X..X.X..X
..............

output:

.WW...00.....??...??.
?..0.0..0...?..1.?..?
?..0.0..0.0.?..1.?..?
.00...00.....11...11.
0..?.0..0.0.1..?.1..?
0..?.0..0...1..?.1..?
.00...00.....??...??.

result:

ok 7 lines

Test #33:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

3
.XX..........XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.

.............XX...XX.
............X..X.X..X
............X..X.X..X
.............XX...XX.
............X..X.X..X
............X..X.X..X
..............

output:

impossible

result:

ok single line: 'impossible'

Test #34:

score: 0
Accepted
time: 12ms
memory: 3664kb

input:

42
.............XX...XX.
X..X.X.........X.X..X
X..X.X.........X.X..X
.XX..................
...X.X..X......X.....
...X.X..X......X.....
.XX..........XX......

.............XX......
X..X.X.........X.X..X
X..X.X.........X.X..X
.XX..................
...X.X..X......X.....
...X.X..X......X.....
.XX..........

output:

.??...??.....11...WW.
1..?.?..?...W..W.1..1
1..?.?..?.0.W..W.1..1
.??...??.....00...00.
?..?.?..?.0.0..1.0..0
?..?.?..?...0..1.0..0
.??...??.....11...00.

result:

ok 7 lines

Test #35:

score: 0
Accepted
time: 11ms
memory: 3600kb

input:

37
.XX...XX.....XX...XX.
X..X....X........X...
X..X....X.X......X...
.XX...............XX.
...X.X....X.X..X....X
...X.X......X..X....X
......XX.....XX......

.XX...XX.....XX...XX.
X..X....X........X...
X..X....X.X......X...
.XX..................
...X.X....X.X..X....X
...X.X......X..X....X
......XX.....

output:

.??...??.....11...11.
1..?.0..?...0..0.1..0
1..?.0..?.?.0..0.1..0
.??...??.....00...WW.
?..?.1..0.?.1..1.0..W
?..?.1..0...1..1.0..W
.??...WW.....WW...00.

result:

ok 7 lines

Test #36:

score: 0
Accepted
time: 13ms
memory: 3604kb

input:

47
......XX.....XX...XX.
........X...X.......X
........X.X.X.......X
.............XX......
.....X..X.X.X..X.....
.....X..X...X..X.....
.............XX...XX.

......XX.....XX...XX.
........X...X..X....X
........X.X.X..X....X
.....................
.....X..X.X.X..X.....
.....X..X...X..X.....
......XX.....

output:

.??...??.....WW...WW.
?..?.?..?...W..W.0..1
?..?.?..?.?.W..W.0..1
.??...00.....WW...00.
?..?.1..?.?.1..W.0..0
?..?.1..?...1..W.0..0
.??...WW.....11...11.

result:

ok 7 lines

Test #37:

score: 0
Accepted
time: 12ms
memory: 3668kb

input:

36
......XX.....XX...XX.
........X......X.X..X
........X......X.X..X
......XX.....XX...XX.
.....X...........X...
.....X...........X...
......XX.....XX...XX.

......XX.....XX...XX.
........X......X.X..X
........X......X.X..X
......XX.....XX...XX.
.....X..............X
.....X..............X
......XX.....

output:

.??...??.....WW...WW.
?..?.?..?...W..W.1..W
?..?.?..?.0.W..W.1..W
.??...??.....??...WW.
?..?.?..?.0.0..W.W..W
?..?.?..?...0..W.W..W
.??...??.....WW...WW.

result:

ok 7 lines