QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#338227#5523. Graph Problem With Small $n$ERosIonAC ✓981ms237260kbC++141.5kb2024-02-25 19:23:132024-02-25 19:23:14

Judging History

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

  • [2024-02-25 19:23:14]
  • 评测
  • 测评结果:AC
  • 用时:981ms
  • 内存:237260kb
  • [2024-02-25 19:23:13]
  • 提交

answer

#include<cstdio>
//#include<ctime>
#include<queue>
#include<algorithm>
#define R register
using namespace std;

const int MAXN = 25;

int n, e[MAXN];
int f[1 << MAXN];
int nx[1 << MAXN];
int nd[1 << MAXN];
int ans[MAXN], start;

char str[MAXN];
inline void read(R int t) {
	scanf ("%s", str);
	for (R int i = 0; i < n; ++ i)
		if (str[i] == '1')
			e[t] |= (1 << i);
}
inline void write(bool fg) {
	if (fg) putchar('1');
	else putchar('0');
}
queue<int>q;
inline void DP() {
	f[1] = 1; 
	nx[1] = e[1];
	for (R int u = 1; u < (1 << n); ++ u) {
		if (!f[u]) continue;
		R int nxt = nx[u] & ((1 << n) - u - 1);
		for (R int i = 1; i <= n; ++ i)
			if ((1 << (i - 1)) & nxt) {
				R int v = u | (1 << (i - 1));
				if (!f[v]) f[v] = 1, q.push(v);
				nx[v] |= e[i]; nd[v] |= (1 << (i - 1));
			}
	}
}
inline void Solve() {
	ans[1] = nd[(1 << n) - 1]; putchar('0');
	for (R int i = 2; i <= n; ++ i)
		if ((ans[1] >> (i - 1)) & 1)
			ans[i] = 1, putchar('1');
		else putchar('0');
	puts("");
	for (R int i = 2; i <= n; ++ i) {
		for (R int j = 1; j < (1 << n); ++ j)
			if ((j & 1) && (nd[j] & (1 << (i - 1))))
				ans[i] |= nd[(1 << n) - j];
		for (R int j = 1; j <= n; ++ j) {
			if (i == j) putchar('0');
			else write((ans[i] >> (j - 1)) & 1);
		}
		puts("");
	}
}

int main()
{
//	start = clock();
//	freopen("a.in", "r", stdin);
//	freopen("a.out", "w", stdout);
	scanf ("%d", &n);
	for (int i = 1; i <= n; ++ i)
		read(i);
	DP(); Solve();
//	printf ("%lf\n", 1. * (clock() - start) / CLOCKS_PER_SEC);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 7820kb

input:

4
0110
1010
1101
0010

output:

0001
0001
0000
1100

result:

ok 4 lines

Test #2:

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

input:

6
010001
101000
010100
001010
000101
100010

output:

010001
101000
010100
001010
000101
100010

result:

ok 6 lines

Test #3:

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

input:

4
0111
1011
1101
1110

output:

0111
1011
1101
1110

result:

ok 4 lines

Test #4:

score: 0
Accepted
time: 74ms
memory: 7680kb

input:

23
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #5:

score: 0
Accepted
time: 71ms
memory: 13936kb

input:

23
00010100000000000101000
00000000010000000001000
00000000000001000000001
10000000000000000010000
00000000000000000000000
10000000000000000000000
00000001000000000000000
00000010000000000010000
00000000000001000000000
01000000000000000000000
00000000000000000000000
00000000000000000000000
000000000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #6:

score: 0
Accepted
time: 80ms
memory: 49344kb

input:

23
00001000000000000000000
00001000010001000000000
00000000000101000010000
00001000000100000000000
11010000010011000100000
00000000000100000000000
00000000000000000000001
00000000000000000101000
00000000000000000000000
01001000000000101010010
00000000000000000000101
00110100000010001000000
000010000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #7:

score: 0
Accepted
time: 90ms
memory: 69692kb

input:

23
01000000000001101001100
10000001101000000000000
00000100000100010000100
00000000000000001011000
00000100001000000000000
00101000000000001000001
00000000000000000000000
01000000000000000000000
01000000000100000010000
00000000000001000000011
01001000000000010000000
00100000100001000100001
000000000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #8:

score: 0
Accepted
time: 111ms
memory: 94720kb

input:

23
00000000010001001001010
00100010001101110000001
01000001000100110000000
00000011010001101100100
00000000010000010001000
00000000000000001001000
01010001000000000000001
00110010000000000000010
00000000011000100100000
10011000101000100000000
01000000110010101010000
01100000000000000000000
000000000...

output:

01111111110111110110111
10011111110111110110111
10011111110111110110111
11101111110110110110111
11110111110111110110111
11111011110111111111111
11111101110111110110111
11111110110111110110111
11111111010111110110111
11111111100110100110111
00000000000010000010100
11111111110011110110111
111111111111...

result:

ok 23 lines

Test #9:

score: 0
Accepted
time: 130ms
memory: 88104kb

input:

23
00001000001001000000000
00101100111110100000000
01001000100001011010000
00000000010000010010000
11100001100001000000010
01000010101010100011011
00000100000100100010000
00001000011000000010001
01101100000000011001001
01010001000010011000000
11000101000110001100000
01000010001000000000010
010001000...

output:

00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
000000000000...

result:

ok 23 lines

Test #10:

score: 0
Accepted
time: 196ms
memory: 94232kb

input:

23
00001011110010000000001
00000100000011000000100
00010011010100000000011
00100011011001010100100
10000101000110100000000
01001000001010001000100
10110000000110000010000
10111000001100010100010
10000000000010001000110
10110000001110100110001
00010101010100001000000
00101011011000100100011
110011101...

output:

00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
000000000000...

result:

ok 23 lines

Test #11:

score: 0
Accepted
time: 229ms
memory: 112700kb

input:

23
00100100001000000100001
00101110110000100100001
11000000000101001000100
00000000010000001111010
01000011010001011001010
11000000010100001001011
01001000001010101000100
00001000001010000000000
01000000000001100001011
01011100001101100000000
10000011010010100000010
00100100010000000001000
000000110...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #12:

score: 0
Accepted
time: 342ms
memory: 117888kb

input:

23
00000001011001011100100
00000001010000000010100
00000001010010100010000
00001000100111100000000
00010100011000010111001
00001000100001000010010
00000001111001100011000
11100010111100110001001
00010111010000101100110
11101011100000100100100
10001011000010100000010
00010001000001011101110
001100000...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #13:

score: 0
Accepted
time: 321ms
memory: 117380kb

input:

23
00100100001101000100000
00010111011000100000010
10000010010001111000010
01001011101001000100000
00010000010110000100111
11000000101000011101001
01110001100000010101100
01010010001001010100000
00010110001100010010001
01101000000011000111000
11010101100010010001101
10001000100010001110100
000010000...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #14:

score: 0
Accepted
time: 392ms
memory: 118784kb

input:

23
01001101001011010101100
10001010111100100001110
00000000010101000111100
00000000001010010100010
11000000100110000111000
10000010001000010101000
01000100100010001100101
10000000010001000110110
01001010000001111100000
01100001000001001101001
11010100000011001010111
01101000000000100100110
100110100...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #15:

score: 0
Accepted
time: 428ms
memory: 120712kb

input:

23
01100101000101001000001
10111000100000010110010
11011010011101000010010
01100010001111011011111
01100010011110001111100
10000000011000001011010
00111001001000101100111
10000010110110011000000
01000001001110010100100
00101101000100111100001
00111110100110011011010
10111001111010001010000
000110011...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #16:

score: 0
Accepted
time: 379ms
memory: 118696kb

input:

23
01111001001110001000101
10000000000100111111110
10010101000110100100101
10101000001010010101001
10010010011110101101111
00100000101100011000000
00001000011000010001101
10100000010000000000100
00000100010110001111100
00001011100101010110111
10011110000000010101101
11101100110010010100000
101110001...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #17:

score: 0
Accepted
time: 421ms
memory: 120552kb

input:

23
01010000000100001110001
10000110010001110010100
00011000101111001010110
10101111011100101100111
00110011111111111011000
01010011100001111011011
01011100001111000011101
00011100001110111010010
00101100011101001000011
01011000100000000000010
00111011100001001000111
10111011100000110100001
001010110...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #18:

score: 0
Accepted
time: 447ms
memory: 121200kb

input:

23
00100101011111000101011
00100001000110000111101
11010000011110010110011
00101101110110000101110
00010101111001110101110
10011001111101010011101
00000000110011000000100
11011100110111001110110
00011111000000100110010
10111111000111101010010
10101100000111111010100
11110101011010101010010
111100110...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #19:

score: 0
Accepted
time: 480ms
memory: 121476kb

input:

23
00100001100011011101011
00111011101101101011001
11001101100100001000111
01001010110101101000010
01110011001111000101111
00100011100000111101010
01011100000110101001100
11101100010110110011000
11110100010010000011010
00010001101011011011011
01001000010001001011111
01111011000010101011101
100010111...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #20:

score: 0
Accepted
time: 146ms
memory: 7972kb

input:

24
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
0000000000000000000000...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #21:

score: 0
Accepted
time: 151ms
memory: 11824kb

input:

24
000000000000100000000000
000000000000000000001000
000000000000000001000000
000000100000000000000000
000000000000000000000001
000000000000000001000000
000100000000100100000000
000000000000000000000000
000000000000000000000000
000000000000010000000000
000000000000000000000000
0000000000000000010000...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #22:

score: 0
Accepted
time: 165ms
memory: 64976kb

input:

24
000000000010000010000000
000000010100100000010010
000010010000000000000000
000000010000000001000000
001000000000001000000000
000000000100101000000000
000000000000000000000000
011100000001000000000000
000000000010000000000000
010001000000000010100001
100000001000000101000000
0000000100000000100100...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #23:

score: 0
Accepted
time: 175ms
memory: 115504kb

input:

24
000001001001101000001101
000000000000011000100100
000000000000010000000000
000000010000000000000000
000000000000000000000000
100000010000000110000000
000000000001000000010000
000101000000000010000000
100000000001011100011100
000000000000000000100000
000000000000000010001000
1000001010001000000010...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #24:

score: 0
Accepted
time: 264ms
memory: 185148kb

input:

24
011010010001001000000011
100000000000000111000001
100110000100100100010001
001011000100001000110000
101101000000000111000010
000110110000010000010000
000001000000000000000000
100001000001100001000001
000000000001000000110011
001100000000010000001000
000000000000000100000000
1000000110000010000000...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000010000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000100000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #25:

score: 0
Accepted
time: 332ms
memory: 198748kb

input:

24
010001010000000000000100
101011011100001011001100
010101010010000100000000
001001101010000000110010
010000000000000000001010
111100000010001101000100
000100000000010000110000
111000000000000011000001
010100000010000000010100
010000000000000001000001
001101001001100110000001
0000000000100100001000...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111110111111
111111111110111111111111
...

result:

ok 24 lines

Test #26:

score: 0
Accepted
time: 575ms
memory: 222604kb

input:

24
010001000001001010000001
100001001110101011001010
000000011000010000000100
000000010000100001110101
000000011001000001100010
110000000000000000011000
000000001000000100011010
001110001010000001110001
011010110000010000001001
010000000000100111100101
010000010000001000000000
1000100000000100101110...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #27:

score: 0
Accepted
time: 546ms
memory: 220040kb

input:

24
010000000000000010000000
100000111000100110000011
000000111110010111000000
000001100001010000001100
000000001000000000110100
000100000100000101101111
011100010111010000110100
011000100010100000100010
011010000011001110000001
001001100010001001000010
001000111100000000100000
0001001010001100001000...

output:

011111111111111111111111
101111111111111101111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #28:

score: 0
Accepted
time: 487ms
memory: 217844kb

input:

24
000100000000010010100000
000000001101000010011011
000000000011000000010000
100010100000100000010000
000100000010110101100001
000000111010100000100101
000101000110000011000000
000001001100101010000011
010001010000000010000101
010000110001011001010000
001011100000010010000011
0110000001000101100101...

output:

011111111111111111111111
101111111111111111011111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #29:

score: 0
Accepted
time: 707ms
memory: 226560kb

input:

24
000000000010110010000001
001010001011101000000110
010001001110000000010000
000000100010000010011101
010001101010010011010100
001010000000011101000010
000110000100101011001111
000000001000110000100000
011010010110000000000000
001000101010001010000100
111110001100100010011101
0100000000001011100000...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #30:

score: 0
Accepted
time: 867ms
memory: 232684kb

input:

24
010001111000001000000110
100001111000000110010000
000011000101000101100100
000001111111000110100100
001000001010010000111000
111100100000000001110000
110101011101000000001101
110100101000001011000100
110110110011001000000000
001100100000000011011001
000110001000100101110111
0011001010000110110100...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #31:

score: 0
Accepted
time: 913ms
memory: 234364kb

input:

24
010000010100011100001111
101010011110111111001010
010101011011100101111100
001000110000100010011011
010000000001010100001011
001000100000011000111001
000101011011001000001100
111100100011010011010100
011000100001000001111111
110000000011110100100010
011000110101000100001000
0010101111101100010001...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #32:

score: 0
Accepted
time: 845ms
memory: 230380kb

input:

24
001011000000111000011011
000100110101100000000100
100001101100110011000010
010011011110101000000110
100101010000100001011110
101110111100100000011111
011001011000001001110011
010111100001110001000110
001101100001110001011011
011101000010010001000100
000100000100001010110110
0100000110000100100100...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #33:

score: 0
Accepted
time: 925ms
memory: 234420kb

input:

24
000010011100100010110100
001011100011110001101010
010001000110100000000111
000001101101011000000111
110000101111000010001111
011100000000011010011000
010110000011100001101010
100000001011101011011101
100110010101101010011010
101110001001010101100101
011010110000011111100000
0101101111000100011011...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #34:

score: 0
Accepted
time: 964ms
memory: 237260kb

input:

24
001101101101001010011100
000010000000011001010101
100011110111100001101011
100011100011110101101100
011100010010001110010110
101100111100000110101100
101101000101011000101101
001011001101010110010101
100001010101110001010110
101001111011110111000000
001110000100011000101101
1011001111001111100101...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #35:

score: 0
Accepted
time: 981ms
memory: 236968kb

input:

24
010010110101111110011001
101100001000000100001010
010010101100010111001100
010011001101001011100111
101100011111101011010101
000100010011010011101011
101000001111101010000101
100011001000011110000111
011110110010101000100011
101110100011000101001001
000011101101010110110100
1001111001101010010000...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #36:

score: 0
Accepted
time: 176ms
memory: 109676kb

input:

23
01111101111011111111001
10111101111011111111111
11011101111011111111001
11101101111011111111001
11110111111111111111101
11111001111011111111001
00001000000100000000100
11111100111011111111001
11111101011011111111001
11111101101011111111001
11111101110011111111001
00001010000000000000100
111111011...

output:

01111111111111111111011
10110101111011111111011
11011111111111111111011
11101111111111111111011
10110111111111111111001
11111011111111111111011
10111101111111111111111
11111110111111111111011
11111111011111111111011
11111111101111111111011
11111111110111111111011
10111111111011111111111
111111111111...

result:

ok 23 lines

Test #37:

score: 0
Accepted
time: 149ms
memory: 82548kb

input:

23
00100000001010010010110
00011111110111101101001
10000000000010000010110
01001111110111101101001
01010111110111101101001
01011011110111101101001
01011101110111101101001
01011110110111101101001
01011111010111101101001
01011111100111111101001
10000000000000010000000
01011111110011101101001
111111111...

output:

00100000001000000010110
00111111111111111111111
11011111101111101111111
01101111111111111111111
01110111111111111111111
01111011111111111111111
01111101111111111111111
01111110111111111111111
01111111011111111111111
01011111101101111101001
11111111110101111111111
01111111111011111111111
011111111001...

result:

ok 23 lines

Test #38:

score: 0
Accepted
time: 104ms
memory: 65448kb

input:

23
00000000000100011000000
00000010001000000011000
00001011010111000000011
00000100100000000101100
00100011010111000000011
00010000100000000101100
01101001011111000011011
00101010010111000000011
00010100000000000101100
00101011000111000000011
01000010000000000011000
10101011010011011000011
001010110...

output:

00101001010111111000011
00111111111011000111011
11001011011111001010011
01000100101000100111100
11100011011111001010011
01010000101000100111100
01101001011011000010011
11101010011111001010011
01010100001000100111100
11101011001111001010011
01111111110011000111011
10101001010011001000011
111010110111...

result:

ok 23 lines

Test #39:

score: 0
Accepted
time: 101ms
memory: 70316kb

input:

23
00000000010100001010010
00011001100010100000001
00000110001011010100100
01001001100010100001001
01010001100010100000001
00100010001011010110100
00100100001011010100100
01011000100010100000001
01011001000010100000001
10000000000100001010010
00100110000011010100100
10000000010000001010010
011111111...

output:

00100110011101011111110
00111011101011110101101
11001111111111110110111
01001001100000100001001
01110011101011110101101
10100010011101010110110
11101101111111110110111
01111010101011110101101
01111011001011110101101
10100110001101011111110
11101111110111110110111
10100110011001011111110
011010111010...

result:

ok 23 lines

Test #40:

score: 0
Accepted
time: 83ms
memory: 48656kb

input:

23
00010100000000001100000
00010000000011000000001
00000011000100010011010
11000100000011001100001
00000100001000000000000
10011000001000001100000
00100001000100010011010
00100010000100010011010
00000000000000100010100
00000000000000010000001
00001100000000000000100
00100011000000010011010
010100000...

output:

01011100000011001100000
10010000010011001100001
00000011110100110011010
11000000000011001100000
10000100101000101100100
10001000000000001100000
00100001110100110011010
00100010110100110011010
00101011001100100011110
01100011000111010001011
00001000100000100000100
00100011110000110011010
110100000100...

result:

ok 23 lines

Test #41:

score: 0
Accepted
time: 83ms
memory: 52436kb

input:

23
00100010100001001001000
00000001000010000000010
10010010110101111011000
00100000010100110010010
00000101001000000000100
00001001001000000000000
10100000100001001001000
01001100001010000000010
10100010000001001001000
00110000000100110010000
00001101000000000000000
00110000010000110010000
010000010...

output:

00100010110101111111001
00010101011110110010010
10000010110101111010000
01000000010110110010010
00000100001000000100100
01001001001010000100100
10100000110101111111001
01000100001010000000000
10100010010101111111001
11110010100111111010010
01001101000010000100100
11110010110011111010010
010101010111...

result:

ok 23 lines

Test #42:

score: 0
Accepted
time: 73ms
memory: 40464kb

input:

23
00000001001000011010000
00001110000100000001011
00000000010000100000100
00000000000011100100000
01000110000100000001011
01001010000100000001011
01001100000100000001011
10000000001000001010000
00000000000010000000001
00100000000000010000000
10000001000100001010000
01001110001000000001011
000100001...

output:

00000001000000011010000
00001111101100001011011
00000000010000000000100
00000000100011100100100
01000111101100001011011
01001011101100001011011
01001101101100001011011
11001110001100011011010
01011110000011000101011
00100000000000010000100
01001111000100001011010
01001111001000001011010
000100001000...

result:

ok 23 lines

Test #43:

score: 0
Accepted
time: 83ms
memory: 57588kb

input:

23
00000000000010000010100
00000011000000010000000
00000101000000100001000
00000000110000000000000
00000000101000101100001
00100001000000100001000
01000001000000000000000
01100110000000100001000
00011000011000000000000
00010000100001000000010
00001000100000000000000
00000000000001000010000
100000000...

output:

00000000000110010010100
00000010000000010000000
00000111000000101101001
00000000111000000000010
00000000001000001100001
00100011000000101101001
01100101000000010001000
00100110000000000001000
00010000001000000000000
00010000000000000000010
00011000100000001100001
10000000000001000010110
100000000000...

result:

ok 23 lines

Test #44:

score: 0
Accepted
time: 64ms
memory: 39784kb

input:

23
00000000100000000001011
00000001000010000010000
00000000000101010100100
00001000010100001000000
00010000010000001000000
00000010000000000101000
00000100000000000101000
01000000000000000010010
10000000000000000000011
00011000001000101000000
00000000010000100000000
00110000000001010100100
010000000...

output:

00000110100000000001001
00000000000010000010000
00011110000101011100100
00101000000101011000100
00110000011101011000100
10100010100001010101101
10100100100001010101101
00000000100000000010011
10000111000000000011011
00001000001000001000000
00001000010010101000000
00111000000001011000100
010000000010...

result:

ok 23 lines

Test #45:

score: 0
Accepted
time: 73ms
memory: 40772kb

input:

23
00100100000001001001010
00000000110100010000000
10000000000000100010000
00001010000000000000001
00010000000000100000001
10000000000001001001010
00010000000010000000000
00000000010000000000100
01000000010100010000000
01000001100100010000100
00000000000000010100010
01000000110000010000000
000000100...

output:

00100100000001001011000
00000001111100010100000
10000100000001001011000
00000010000000000000001
00000000000000100010001
10100000000001001111010
00010000000010000000001
01000000110110000000100
01000001011100010100000
01000001100100000000000
01000000100100010100000
01000001111000010100000
000000110000...

result:

ok 23 lines

Test #46:

score: 0
Accepted
time: 70ms
memory: 40340kb

input:

23
00000001000000100000000
00010100000010000000000
00000010101000010011001
01000100000000000000000
00000001000000001000000
01010000000001000000000
00100000101000010011001
10001000000000100000000
00100010001000010011001
00000000000101000000010
00100010100000010011011
00000000010000000000010
010000000...

output:

00001001000000100100000
00010000000010000100000
00000010101100010011111
01000100000011000100000
10000001000000001000000
00010000000001000000000
00100000101100010011111
10001000000000000000000
00100010001100010011111
00000000000101000000000
00100010100100010001011
00100010111001010001011
010100000000...

result:

ok 23 lines

Test #47:

score: 0
Accepted
time: 70ms
memory: 30476kb

input:

23
00011001001000000010000
00010000000000000000001
00000000000010010000010
11001001001000000000000
10010001001000000000000
00000000000100000000100
00000000000000110000100
10011000001000000000000
00000000010001000000000
00000000100000001000010
10011001000000000000000
00000100000000000100000
001000000...

output:

00001001001000000010000
00011001001000000001001
00000010000010111000010
01001001001000000000000
11010001001000000010000
00000010000100100000100
00100100000010110000100
11011000001000000010000
00000000010001001001000
00000000100000001000000
11011001000000000010000
00000100000000000100000
001000100000...

result:

ok 23 lines

Test #48:

score: 0
Accepted
time: 76ms
memory: 32792kb

input:

23
00010010001000000000000
00000000000000000100001
00001100000000000000000
10001010001000010001000
00110000000000010001000
00100000000001000000000
10010000001000000000000
00000000000000000010110
00000000010000001000000
00000000101000000000000
10010010010000000000000
00000000000000001000001
000000000...

output:

00010010011000010001000
00000000000110100100001
00001100000000010001000
10000010000000010001000
00100000000000010001000
00100000000001000000000
10010000011000010001000
00000000000000100010100
00000000010100001000000
10000010101000000000000
10000010010000000000000
01000000100000001000001
010000000000...

result:

ok 23 lines

Test #49:

score: 0
Accepted
time: 75ms
memory: 31312kb

input:

23
00000100000100000100000
00001000000000000001000
00000000000000001010000
00000001000000001000000
01000000010000000001000
10000000000100000100000
00000000001100000000001
00010000000000011000000
00000000000000000110100
00001000000010000000000
00000010000100000000000
10000110001000000100000
000000000...

output:

00000100101100000100100
00001000010000100001000
00010000000000001010100
00100001000000011000000
01000000010000000000000
10000000101100000100100
00000000001000000000001
00010000000000010000000
10000100000000000100100
01001000000010000000000
10000110000100000000001
10000100001000000000000
000000000100...

result:

ok 23 lines

Test #50:

score: 0
Accepted
time: 72ms
memory: 29436kb

input:

23
00000010000000000000010
00100000000001001000000
01000000000000001010000
00000000100010000000000
00000000000001000001000
00000010000000000000101
10000100000000000000101
00000000001000000000010
00010000000000000000100
00000000000000110001000
00000001000000010000000
00000000000010000110000
000100000...

output:

00000110000000000000011
00001000000001001000000
00000000000000001010000
00000000100010000100000
01000000000001101001000
10000010100000000000101
10000100000000000000001
00000000001000000000010
00010100000000000000101
00000000000000110000000
00000001000000010000000
00000000000000000110000
000100000000...

result:

ok 23 lines

Test #51:

score: 0
Accepted
time: 71ms
memory: 29048kb

input:

23
00100000010000000000010
00100000000000000000001
11000000000000000000010
00000000000000100010000
00000000001000000001000
00000000000000010000100
00000000000001010000001
00000000010010001000000
00000000001100000100000
10000001000000000000000
00001000100000000100000
00000000100000000010000
000000010...

output:

00000000010000000000010
00100010000001000000011
01000000000000000000010
00000000000000100010000
00000000001000000101000
00000010000001010000100
01000100000001010000001
00000000010000001000000
00000000000100000100000
10000001000000001000010
00001000000000000100000
00000000100000000110000
000000000000...

result:

ok 23 lines

Test #52:

score: 0
Accepted
time: 72ms
memory: 29252kb

input:

23
00000000010000000001000
00100000100000000000000
01000000000000000000001
00001100000000000100000
00010000000100000100000
00010010000000000010000
00000100000000000011000
00000000000100001000000
01000000000000000000010
10000000000000010000001
00000000000000000000110
00001001000000000000000
000000000...

output:

00000000010000010001000
00100000100000000000000
01000000000000010000001
00000100000000000110000
00000000000100000100000
00010000000000000110000
00000000000000000011000
00000000000100101000000
01000000000000000000010
10000000000000010000000
00000000000000000000110
00001001000000000100000
000000000000...

result:

ok 23 lines

Test #53:

score: 0
Accepted
time: 75ms
memory: 26412kb

input:

23
00000010000001010000000
00010000000000000100000
00000000010100000000000
01000000000010000000000
00000001000000000001000
00000000000001001000000
10000000000001000000000
00001000000000000000010
00000000001000000000001
00100000000100000010000
00000000100000000000101
00100000010000000100000
000100000...

output:

00000010000000010000000
00010000000000000100000
00000000010100000110000
01000000000010000000000
00000001000000000001000
00000010000001001000000
10000100000001010000000
00001000000000000000010
00000000001000000001101
00100000000000000010000
00000000100000000000100
00100000000000000100000
000100000000...

result:

ok 23 lines

Test #54:

score: 0
Accepted
time: 75ms
memory: 26396kb

input:

23
00000000000010000100000
00001000000000000000100
00010000000000010000000
00100100000000010000000
01000000000000001001000
00010010000000000000000
00000100100000000000000
00000000010000000100000
00000010000010000000000
00000001000100000000000
00000000000000100000001
00000000010000000000010
100000001...

output:

00000000000010000100000
00001000000000000001100
00010100000000011001000
00100100000000000000000
01000000000000000001000
00110010000000000000000
00000100100000000000000
00000000010000000100000
00000010000010000000000
00000001000100000000000
00000000000000100000001
00000000010000000000010
100000001000...

result:

ok 23 lines

Test #55:

score: 0
Accepted
time: 77ms
memory: 26472kb

input:

23
01010000000000000000000
10100000000000000000000
01000000000000000001000
10000000010000000000000
00000000000000000110000
00000000000100010000000
00000000000000010100000
00000000000010000000001
00000000001001000000000
00010000000000100000000
00000000100001000000100
00000100000000000000100
000000010...

output:

01010000000000000000000
10100000000000000000000
01000000000000000001000
10000000010000000000000
00000000000000000110000
00000000000100010000000
00000000000000010100000
00000000000010000000001
00000000001001000000110
00010000000000100000000
00000000100000000000100
00000100000000000000100
000000010000...

result:

ok 23 lines

Test #56:

score: 0
Accepted
time: 74ms
memory: 26664kb

input:

23
01001000000000000000000
10000100000000000000000
00000000100000100000000
00000001000001000000000
10000000000001000000000
01000000000000000100000
00000000000000100000010
00010000001000000000000
00100000010000000000000
00000000100010000000000
00000001000000000000010
00000000000000010001000
000000000...

output:

01001000000000000000000
10000100000000000000000
00000000100000100000000
00000001000001000000000
10000000000001000000000
01000000000000000100000
00000000000000100000010
00010000001000000000000
00100000010000000000000
00000000100010000000000
00000001000000000000010
00000000000000010001000
000000000100...

result:

ok 23 lines

Test #57:

score: 0
Accepted
time: 420ms
memory: 197016kb

input:

24
011101010110111111101110
101101010110111111101110
110101010110111111101110
111001010110111111101110
000000101001000000110001
111100010110111111101110
000010001001000000110001
111101000110111111101110
000010100001000000110001
111101010010111111101110
111101010101111111101110
0000101010100000001100...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111011111
111111111110111111011111
...

result:

ok 24 lines

Test #58:

score: 0
Accepted
time: 430ms
memory: 181988kb

input:

24
000000111000000010000000
001111010111111101111111
010111010111111101111111
011011010111111101111111
011101010111111101111111
011110010111111101111111
100000001000000010000000
111111000111111101111111
100000100000000010000000
011111010011111101111111
011111010101111101111111
0111110101101111011111...

output:

011111111111111001111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111001111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #59:

score: 0
Accepted
time: 241ms
memory: 162976kb

input:

24
010011101111010010010001
100011101111010010010001
000000010000001001000100
000000001000100101101010
110001101111010010010001
110010101111010010010001
110011001111010010010001
001000000010001001000100
110111100111110110010001
110011101011010010010001
110011111101010010010001
1100111011100100100100...

output:

011011111111111110010101
101011111111111110010101
110011110111011011111111
000000000000100100101010
111001111111111110010101
111010111111111110010101
111011011111111110010101
111011100111011010010101
110011100101110110010001
111011111011111110010101
111011110101011010010101
111011111110111110010101
...

result:

ok 24 lines

Test #60:

score: 0
Accepted
time: 218ms
memory: 133768kb

input:

24
000000100000001000101001
001010001101010110010010
010011001101010110010010
000001010000101001000100
011000001101010110010010
001100010000101001000100
100000000000001000101000
000101000000101001000100
011010000101010110010010
011010001001010110010010
000000000000010000000001
0110100011000101100100...

output:

000000100010000000101001
001111011111110111010110
010111011101100111010110
011011111101101111111110
011101011111110111010110
011110011101100111010110
100100010010101001101101
011111101101101111111110
011111010111110111010110
011111011011110111010110
110010101101010110111011
011111011110110111010110
...

result:

ok 24 lines

Test #61:

score: 0
Accepted
time: 198ms
memory: 123260kb

input:

24
001010000100010000010001
000100101000100010001010
100110000100010000010001
011000001000000000000000
101000000110010000010001
000000010010000100000000
010000000000100010001010
000001000010000100000000
010100000000000000000000
101010000000010000010001
000011010000000100000000
0000000000000011011011...

output:

001111011110010000010001
000000101000100010000010
100100001100010000010001
101000001100010000010001
100001010110010000010001
100010010111011101110101
010000001001101011101110
100011000111011101110101
111100100100110010010011
101111011010010000010001
100011010100010000010001
000001110000101111101110
...

result:

ok 24 lines

Test #62:

score: 0
Accepted
time: 172ms
memory: 77356kb

input:

24
001001000001001000000000
000110000000010000110100
100001000101001001010000
010010000000010000110100
010100000000010000110100
101000000001001000000001
000000001010000000101010
000000000000100110000010
000000100010000000001010
001000000000000001010000
000000101000000000001010
1010010000000010000000...

output:

001001000101001001000001
000110101110010001111100
100000000101001001000000
010010101110010001111100
010100101110010001111100
100000000001001000000001
010110001010010000101100
000000001010100110001011
010110110010010110101110
111110000001011001010100
010110111000010110101110
101001000100001001000001
...

result:

ok 24 lines

Test #63:

score: 0
Accepted
time: 166ms
memory: 77976kb

input:

24
000001101000100000000100
000000000100001010000001
000000010001000100111010
000010001000000000000000
000100001000010001000001
100000101000100000000100
100001001010100000000100
001000000000000100001010
100111100000100000000100
010000000000001010000001
000000100000000000010000
0010000000000000001100...

output:

000101101010100000000100
000000010100011111001011
000000010001000100100010
100011001000110001000100
000100000000010001000000
100100101010100000000100
100001000010100000000100
011000000101001110101010
100101000000100000000100
010000010000011111001011
100001100001100000110100
001000010010000100110010
...

result:

ok 24 lines

Test #64:

score: 0
Accepted
time: 170ms
memory: 67116kb

input:

24
000110001100000011000010
000000000001110000000100
000000010010000100010000
100010001100000011100010
100100001100000011000010
000000110000000000001000
000001010000000000001000
001001100000000000001000
100110000100000011000010
100110001000000011000010
001000000000000100010100
0100000000001100000001...

output:

000110001100000011100011
000000000011111100010100
000001110000000100010000
100010001100000011100000
100100001100000011100011
001000110000000100011001
001001010000000100011001
001001100000000100010000
100110000100000011100011
100110001000000011100011
010000000001010100010100
010000000010111100010100
...

result:

ok 24 lines

Test #65:

score: 0
Accepted
time: 165ms
memory: 71516kb

input:

24
011010100011011000110000
101010100011011000110000
110010100011011000110000
000001000100000010001000
111000100011011000110000
000100000100000110000000
111010000011011000110000
000000000000100000001010
000000000000000100000001
000101000000000010000000
111010100001011000110100
1110101000100110001100...

output:

011010100011011000110101
101010100011011000110101
110010100011011000110101
000000010100000010001010
111000100011011000110101
000000000100000110000000
111010000011011000110101
000100000100100011001010
000000000000000100000001
000101010000000110001010
111010100000011000110100
111010100000011000110001
...

result:

ok 24 lines

Test #66:

score: 0
Accepted
time: 151ms
memory: 42128kb

input:

24
000000000000010100000000
000000100000001011010100
000100000000000000000010
001000000000100000001000
000000000100000000000100
000000000000000000000011
010000000000001011010100
000000000111000000000000
000000000001000000101000
000010010011000000000100
000000010101000000000000
0000000111100000001010...

output:

000000000000010100000000
000010100000011011010100
000101000000100000000010
001000000000100000000000
010000110110001001010100
001000000000000100000011
010010000000011011010100
000010001111000000100000
000000010011100000101000
000010010010000000000000
000010011101000000100000
000000011010000000100000
...

result:

ok 24 lines

Test #67:

score: 0
Accepted
time: 155ms
memory: 56876kb

input:

24
000100001000000000000000
000000000010000001000000
000000100001100010000001
100001001000000000000000
000000000000000101000010
000100000010000000000000
001000010001101010010001
000000100000001000010000
100100000000000000101100
000000000000010000010000
010001000000000000000000
0010001000001000100000...

output:

000101001000000000101000
000010000010000001000010
000000110001101010101101
100001000000000000000000
010000000000010101000010
100100000010000000000000
001000010001101000000001
001000100101101000010001
100000000000000000101000
000000010000011000010000
010001000000000000000000
001000110000101010101101
...

result:

ok 24 lines

Test #68:

score: 0
Accepted
time: 164ms
memory: 55188kb

input:

24
000001100000000000000000
000010000001000000010000
000000000000001001000000
000000000010010100000000
010000000000000000010000
100000001000000000001000
100000000000000000000011
000000000100100011100000
000001000000000000001000
000000010000100011100000
000100000000010100000001
0100000000000000100000...

output:

000001101000000000000010
000010000001000000000000
000000010100101001100100
000000000010010100000111
010000001001000000011000
100000001000000000000000
100000000000000000000010
001000000101100011100000
100011000000000000011000
001000010001100011100000
000100000000010000000011
010010010100100010100000
...

result:

ok 24 lines

Test #69:

score: 0
Accepted
time: 151ms
memory: 44460kb

input:

24
000010001000000000000000
000000000011110000000000
000100000100000001000001
001000000100100001010001
100000000001000000000000
000000000000000100001110
000000000000001000000100
000000000000000010100000
100000000000000000100000
001100000000000001000001
010000000000110000000000
0100100000000000000000...

output:

000010001000000000000000
000000000011010000000000
000101000100000101011011
001000000100000001010000
100000000001000000000000
001000100100000101001111
000001000000001100001100
000000000000000010100000
100000000000000000100000
001101000000000101011011
010000000001110000010000
010010000010010000000000
...

result:

ok 24 lines

Test #70:

score: 0
Accepted
time: 154ms
memory: 45924kb

input:

24
000000000001000010100000
001000100000000000000000
010000000000010000000000
000000000000000010000100
000000000001000101010000
000000100000000000001000
010001000000000000000000
000000000000000000001001
000000000110000000000000
000000001010101000000000
000000001100000000010000
1000100000000001111100...

output:

000110000001000111100000
001000100000000000000000
010000000000010000000000
100000000000000010100101
100000001011000101110000
000000100000000000001000
010001000000000000000000
000000000000000000001001
000010000110100101010000
000000001000100000000000
000010001000000101010000
100010000000000101100000
...

result:

ok 24 lines

Test #71:

score: 0
Accepted
time: 150ms
memory: 48852kb

input:

24
000100000100000000001000
000000000000000001001000
000000000010000000100100
100000000100000000000000
000000011000000000000000
000000001001000000010000
000000000011001000000000
000010000000000000000010
000011000001000000010000
100100000000000010000000
001000100001001000000000
0000011010100010000100...

output:

000100000000000000001000
000000000000000001001000
000000100010001000100000
100000000100000010001000
000001011000000000010000
000010101001001000010000
001001000011001000110000
000010000000000000000011
000011000000000000010000
000100000000000010000000
001000100000001000100000
000001100000001000010000
...

result:

ok 24 lines

Test #72:

score: 0
Accepted
time: 148ms
memory: 37688kb

input:

24
000011000000000000000000
000000100000000000000100
000000000100000000100000
000001000000000100000000
100001000000100010000001
100110000000000000000000
010000000000001000100000
000000000000000100000100
000000000000010000010001
001000000010000000000000
000000000101000000000000
0000000000100000000010...

output:

000111000000100010000000
000000100000001000000100
000000000100001000100000
100001000000000100000000
100000000000100010000000
100100000000000000000000
010000000000001000000000
000000000000000100000100
000000000000110011010001
001000000010000000000000
000000000101000000000000
000000000010000000001000
...

result:

ok 24 lines

Test #73:

score: 0
Accepted
time: 155ms
memory: 39608kb

input:

24
000000000000100000100001
000100000010000000000000
000000000000000010001000
010000000000000000000001
000000000001001000000010
000000100100000001000000
000001000010000000000000
000000000000010000001000
000000000000010000010000
000001000000000001000000
010000100000000000000000
0000100000000011000000...

output:

000000000000100000000001
000100000010000000000000
000000010000000010001100
010000000000000000000001
000000000000001000000010
000000100100000000000000
000001000110000000000000
001000000000010000001000
000000000000010000010000
000001100000000101000000
010000100000000000000000
000000000000001100000000
...

result:

ok 24 lines

Test #74:

score: 0
Accepted
time: 152ms
memory: 41020kb

input:

24
000000000000100000001000
000000000010010000000000
000010010000000000000100
000000010000000000100000
001000000000000000000110
000000000100001000000000
000000000000010010000000
001100000000000000100000
000000000000000000001010
000001000000000001000001
010000000000010001000000
0000000000000001001000...

output:

000000000000100000001000
000000100010010001000001
000100010000000000000100
001000010001000000100100
000000000000000000000110
000000000100001000000001
010000000000010010000000
001100000000000000000100
000000000000000000001010
000001000000000000000001
010000000000000001000001
000100000000000100100000
...

result:

ok 24 lines

Test #75:

score: 0
Accepted
time: 150ms
memory: 32728kb

input:

24
000001100000000000000000
000000000010000000000001
000000000000101000000000
000000000010000000001000
000000100000010001000000
100000100100000000000000
100011000000000001000000
000000001000100000000000
000000010000000000000100
000001000001000000000000
010100000000000000000001
0000000001000000000001...

output:

000001100100000001000000
000100000010010000000001
000000000000101000000000
010000000010000000001000
000000000000010001000000
100000000100000000000000
100000000000000001000000
000000001000100000000000
000000010000000000000100
100001000001000000000000
010100000000000000000000
000000000100000000000100
...

result:

ok 24 lines

Test #76:

score: 0
Accepted
time: 149ms
memory: 28616kb

input:

24
000000100000000000001000
001010000000000000000000
010001000000000000000000
000000000111000010000000
010000010000000000000000
001000000000010000000000
100000000000000000000001
000010000000000000000010
000000000000100000000001
000100000011000000000000
000100000101010000000000
0001000001100000000000...

output:

000000100000000000001000
001010000000000000000000
010001000000000000000000
000000000101000010000000
010000010000000000000000
001000000000010000000000
100000000000000000000001
000010000000000000000010
000000000000100000000001
000100000011010010000000
000000000101010000000000
000100000110010010000000
...

result:

ok 24 lines

Test #77:

score: 0
Accepted
time: 149ms
memory: 28636kb

input:

24
010000000000000000100000
101000000000000000000000
010000000000000001000000
000010000001000000000000
000100000000000010000000
000000000000000001000001
000000000000000000000011
000000000000100000001000
000000000010000000000100
000000000010000100000000
000000001100000000000000
0001000000000110000000...

output:

010000000000000000100000
101000000000000000000000
010000000000000001000000
000010000001010000000000
000100000000000010000000
000000000000000001000001
000000000000000000000011
000000000000100000001000
000000000010000000000100
000000000010000100000000
000000001100000000000000
000100000000010000000000
...

result:

ok 24 lines

Test #78:

score: 0
Accepted
time: 153ms
memory: 26344kb

input:

24
000000000000010000010000
000100000000000001000000
000000010000000000000001
010000000000000000000010
000000000000000100100000
000000000100000000000100
000000000001000100000000
001000000000000010000000
000000000100001000000000
000001001000000000000000
000000000000000000010001
0000001000000000010000...

output:

000000000000010000010000
000100000000000001000000
000000010000000000000001
010000000000000000000010
000000000000000100100000
000000000100000000000100
000000000001000100000000
001000000000000010000000
000000000100001000000000
000001001000000000000000
000000000000000000010001
000000100000000001000000
...

result:

ok 24 lines