QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#112075#3887. Logic Puzzlelmq26052003WA 4ms4388kbC++201.3kb2023-06-09 20:10:092023-06-09 20:10:13

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3488kb

input:

2 3
1 1 2 1 1
1 2 3 2 1
1 2 3 2 1
0 1 1 1 0

output:

X.X
.X.

result:

ok correct solution

Test #2:

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

input:

1 2
0 0 1 1
0 1 1 1
0 1 1 1

output:

impossible

result:

ok impossible

Test #3:

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

input:

1 1
1 1 1
1 1 1
1 1 1

output:

X

result:

ok correct solution

Test #4:

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

input:

2 1
1 1 1
2 2 2
2 2 2
1 1 1

output:

X
X

result:

ok correct solution

Test #5:

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

input:

97 93
1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1
2 4 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 ...

output:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX...

result:

ok correct solution

Test #6:

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

input:

94 99
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

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

result:

ok correct solution

Test #7:

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

input:

10 8
1 2 3 3 3 3 3 3 2 1
2 3 5 5 6 6 6 6 4 2
3 5 8 8 9 9 9 9 6 3
3 5 8 8 9 9 9 9 6 3
3 6 9 9 9 9 9 9 6 3
3 6 9 9 9 9 9 9 6 3
3 6 9 9 9 9 9 9 6 3
3 6 9 9 9 8 8 8 6 3
3 6 9 9 9 8 8 8 6 3
3 6 9 9 9 8 8 8 6 3
2 4 6 6 6 6 6 6 4 2
1 2 3 3 3 3 3 3 2 1

output:

XXXXXXXX
X.XXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXX.XX
XXXXXXXX
XXXXXXXX

result:

ok correct solution

Test #8:

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

input:

7 11
0 0 0 0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 0 0 1 1 1
0 1 1 1 0 0 0 0 0 0 1 1 1
0 1 1 1 0 0 0 0 0 0 0 0 0
0 1 1 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0 0 0 0 0

output:

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

result:

ok correct solution

Test #9:

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

input:

3 77
0 1 1 2 1 1 0 1 1 2 2 2 2 2 2 2 1 2 1 1 1 1 2 1 1 1 1 2 2 3 2 1 1 1 2 2 3 2 2 2 2 2 1 1 0 1 1 2 2 3 3 3 2 2 1 1 1 1 1 1 1 2 2 3 2 2 2 3 2 2 2 3 2 1 0 1 2 2 1
1 3 4 4 3 2 2 2 3 3 3 2 3 4 4 3 2 3 3 3 3 3 3 2 2 2 3 4 5 6 5 4 3 3 3 3 3 3 4 5 4 4 2 3 2 4 3 4 3 4 4 5 5 4 3 3 4 4 4 4 3 4 4 6 4 4 3 5 4...

output:

.X.X...X.XX.XX.X.X..X.X..X.XXX..X.XXX.XX.X...X.XXXXX.X..X..X.XXX.XXX.XXX...XX
XXX.X.X.X...XX..X.XX.X..X.XXXXXX.X...XXX.X.XXX.X..XXX.XXXXXX.XXX.X.XXXX.XX.XX
XXXXXXX.XX....X..XX.........X.X..X..X.X...XXXXXXXX......XXXXXX..XX....X..X..X

result:

ok correct solution

Test #10:

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

input:

54 64
0 0 1 2 3 2 2 2 3 3 2 2 1 2 1 2 2 2 2 2 3 3 3 2 1 0 1 1 2 2 2 2 1 1 1 1 2 1 1 0 0 1 1 2 1 2 1 1 1 1 2 2 2 2 2 3 2 2 2 3 3 2 2 1 1 0
1 2 4 5 5 3 2 2 4 4 3 2 1 3 3 4 4 4 5 4 4 4 5 5 4 3 4 3 3 3 4 4 2 1 1 2 4 3 2 1 2 3 2 2 1 3 2 2 2 2 3 2 2 2 3 4 3 3 4 6 5 3 2 2 2 1
2 4 7 8 7 5 3 3 4 5 4 4 3 6 6 ...

output:

..XXX.XXXX.X.X.XX.XXXXX...X.XX.X..X.X....X.X.X..X.XX.XXX.XXXX.X.
XXXX....X....XX.XXX..XXXXXX..XX....XX..XX....X..X.....X..XXX...X
XXXX.X...X.XXXX...XXXX...X.X.XX.XX.XXX...XX.XXX.......XX..XX.X..
.X.....X...X.X.X...XX...X...XXX.XXX....XX.X..X.X.XX...X...X...X.
.X.XXXXX..XX..XXX...X...X.X.XXX.....XX.....

result:

ok correct solution

Test #11:

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

input:

54 3
1 1 2 1 1
1 2 4 3 2
1 2 4 3 2
1 2 4 3 2
1 2 3 2 1
1 3 4 3 1
0 2 3 3 1
0 1 2 2 1
0 1 3 3 2
1 2 3 2 1
2 3 5 3 2
3 4 6 3 2
3 4 6 3 2
3 4 5 2 1
3 3 3 0 0
2 3 4 2 1
2 3 4 2 1
2 3 5 3 2
3 4 6 3 2
3 5 7 4 2
2 5 6 4 1
2 4 4 2 0
2 3 3 1 0
3 3 4 1 1
2 3 4 2 1
2 3 5 3 2
2 4 5 3 1
3 5 7 4 2
3 6 8 5 2
2 5 8...

output:

X.X
.XX
...
X.X
.X.
.X.
..X
...
.XX
X..
X.X
XXX
X..
X..
X..
.XX
X..
X.X
XXX
XX.
.X.
X..
X..
X.X
.X.
X.X
XX.
XXX
XXX
.XX
XX.
.XX
.X.
XX.
X..
XXX
XXX
.X.
X..
XXX
.XX
XXX
X.X
...
X.X
..X
X..
X..
..X
..X
.X.
.X.
.XX
.X.

result:

ok correct solution

Test #12:

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

input:

79 27
0 1 2 2 1 0 0 1 2 3 2 2 2 3 2 2 1 1 1 2 3 3 2 1 0 1 2 2 1
1 3 5 4 2 1 2 4 4 4 3 4 4 5 3 3 2 3 4 4 4 3 2 1 0 2 4 4 2
1 3 6 5 4 3 4 5 4 4 3 5 5 7 5 5 4 5 7 6 5 4 4 4 2 3 4 4 2
1 2 4 3 4 4 6 5 3 2 2 5 5 7 6 6 5 6 8 7 5 4 4 5 3 3 3 3 2
0 0 1 1 4 5 7 4 3 2 2 4 5 8 7 6 5 5 6 6 5 5 5 6 5 4 4 3 2
1 2 ...

output:

.XX....XXX.XXX.X..XXXX...XX
XXX..XXX..XX.X..XXX......XX
..X.XX.....X.XX.XXX..XXX...
....X.X..X.XXXXX.XXXXX.X..X
....XXX.X..XXX..X..X..X.XXX
XXXX...X.X.XXXXX.X.XX..XXXX
.XXXXXXXX.XXXX.XXXX..XX.X.X
X.XX.......X.XXXXX.XX...X.X
.X..X.X.X.X.X.XX.XX.XXXX.X.
XX.XX.X....X.XXX.XX..XXXXXX
X.XXX..X.XXX..XXXXXX...

result:

ok correct solution

Test #13:

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

input:

16 24
0 0 1 1 2 1 1 0 1 2 2 2 1 2 2 3 2 1 0 1 1 2 2 3 2 1
1 2 4 4 4 3 2 2 3 4 3 3 2 4 3 4 3 3 2 3 2 4 4 6 4 2
1 2 5 6 6 4 3 3 4 5 4 5 3 6 5 6 5 5 4 4 3 5 6 7 5 2
1 3 5 7 6 5 3 3 4 4 3 3 3 5 4 4 4 6 6 6 4 4 4 4 3 1
0 1 3 5 6 5 5 3 4 3 4 4 5 5 4 4 5 7 7 6 4 2 2 1 1 0
0 1 2 4 6 6 5 2 4 3 4 3 6 5 3 3 4 ...

output:

..X.X...XX.X.XXX...X.XXX
XXXX.X.XX..X.X..XX.X.XXX
..XX..X..X.X.XX.XX..X.X.
.X.XX...X...X..X.XXX....
..X.XXX.X.XXX..XXXX.....
...XX...X..XX..X....XXX.
.XXX...XX...XXXXX.XX..XX
....X.X..X.X...XXX.XX.XX
.XXX..XXX.XX.X.X...XXXXX
X.XX.X.XX.X.XXX..X.XX...
XXXXXXXXXXX.X..X......XX
.X.X.X..X..XX.XX.X..XX..
...

result:

ok correct solution

Test #14:

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

input:

83 84
1 2 3 2 2 1 1 1 1 2 2 3 2 1 1 2 2 1 1 1 1 0 0 0 0 0 1 2 3 3 2 2 1 1 0 0 0 0 0 1 1 1 1 2 3 2 2 1 2 1 1 0 1 2 3 2 1 1 1 1 1 2 2 1 1 1 1 0 1 2 2 1 1 2 3 3 2 2 2 2 1 0 1 1 1 0
1 3 4 4 4 4 3 3 2 4 4 5 3 1 2 3 3 1 1 1 1 0 1 2 2 2 2 3 3 3 3 4 3 2 1 1 2 1 2 2 2 2 3 4 4 3 4 4 4 2 2 1 3 4 5 4 3 3 2 1 2 ...

output:

XXX.X..X.XXX..XX..X.......XXXX.X.......X..XXX.X.X...XXX..X..XX..X...XX..XXXX.XX...X.
.X.XXX.X.XX...X.......XX.X....XX..X.X.X..XX..XXX..X.XX.XX...X..X....X.X..XXXX...X.X.
.X...XX....XX..XX..X.XX.....X.X...XX.XX.....X...X..X...X.X..XX....X.XXX....XXX...X.X
.XXX.XX.X.X.XXXXXXXXX.XX.....X.X.X.XX..XX..XX...

result:

ok correct solution

Test #15:

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

input:

21 25
1 1 1 0 0 1 1 1 0 1 1 1 0 1 2 2 2 2 3 3 2 2 1 1 1 1 1
1 2 3 2 2 3 4 3 1 1 2 3 3 3 3 2 3 4 6 5 4 3 2 2 2 2 1
2 3 4 2 3 5 7 6 4 4 5 6 6 5 5 3 4 5 8 8 6 4 2 2 2 2 1
2 3 5 3 4 4 6 5 5 5 6 7 7 6 5 3 4 4 6 6 5 4 2 2 2 2 1
3 4 5 2 2 3 4 5 6 8 7 6 5 6 7 6 6 5 5 6 4 5 3 4 3 2 1
3 4 6 4 4 4 4 5 6 7 5 4 ...

output:

X....X...X...XX.XXXX.X..X
.XX.XXX...XXX...XXX.X..X.
X...XXXXXXXXX.X..XXX.....
X.X.....XX.X.XX.X..X.X..X
XX...X.XXX..XXXXXX.X.XXX.
X.XXXXXXX..XX..XXXX.X...X
.X..XXX.XX..X...X...X...X
X...X.XXXXX.X..XXXX.....X
X..XX.XXXXXXX.XX..X..X..X
...XX.....XX.X..X.X..X...
XX...XXX..X.XXX.XXXX.XXXX
XXX......XX......

result:

ok correct solution

Test #16:

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

input:

60 34
0 1 1 1 0 1 2 2 1 1 2 2 1 1 1 1 0 1 2 3 3 3 3 3 3 2 2 1 1 0 1 2 3 2 1 0
1 2 3 3 3 3 3 3 3 4 5 4 2 1 2 3 2 3 4 6 6 6 5 5 4 3 3 2 2 1 2 3 3 2 1 0
2 3 5 4 5 5 5 5 5 7 8 7 5 3 4 5 4 5 6 8 7 7 7 7 5 3 3 3 3 3 3 4 3 2 1 0
3 3 6 4 7 6 5 5 6 9 8 7 6 4 5 5 6 5 5 6 6 7 6 5 2 2 2 4 3 4 3 3 2 2 2 1
3 4 7 ...

output:

.X...XX..XX..X...XXXXXXXX.X...XXX.
X.XXX..XXXX...XX.XXXXX.X..X..X....
X.X.XX.XXXXXX.XX.XX..XX....X.X....
X.X.XX.XXX.XX.X.X..XXX...X.X..X.XX
XXXXXXXXXX.X..XX.X.XXX..XXXXX.XX.X
XXXXXX...XX....X..XX.X....X..XXXXX
XX...XX...XX..X.X...XXX.X..X..XX..
.X...XX...X.XXXX.XX..X.XXX..XXXXXX
..XXX...XX.XX..XXX.....

result:

ok correct solution

Test #17:

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

input:

44 95
0 1 1 2 1 2 2 3 3 3 3 2 1 0 1 2 3 2 1 1 2 2 1 1 1 2 2 2 1 0 0 1 1 2 2 2 1 1 1 1 0 0 0 1 1 1 1 1 2 1 1 1 2 3 2 1 0 0 0 1 1 2 2 3 3 3 2 1 1 1 1 0 1 2 3 2 1 1 1 1 1 2 2 2 1 2 2 3 3 2 2 1 1 1 1 1 0
0 2 2 3 2 4 5 6 6 6 6 5 3 2 2 4 5 4 2 1 3 4 3 3 3 5 5 4 2 1 2 4 4 4 3 2 1 1 1 2 1 1 1 3 3 2 2 3 5 4 ...

output:

.X.X.XXXXXX...XXX..XX..X.XX....X.XX..X.....X..X.X..XXX.....X.XXXXX..X...XXX..X..XX.X.XXXX.X..X.
.X..XXXXXXXX.X.XX...XX.XXXX..XXXX......X..XX..XXXX..XX.XXX..X.....XXX.XXXXX....X.X..XX.XXX....X
XXX.X..X.X.X.XX..XXX.......XXXX.XXXX...X.X..X.X....XXXX...X..XX..X.XXX..XXXX...XXX.XX...X...X.X
.X..XXX.XXX....

result:

ok correct solution

Test #18:

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

input:

10 87
1 2 2 2 2 3 3 2 2 2 2 2 1 1 1 1 2 2 3 2 1 0 1 2 2 2 2 2 1 0 0 0 1 2 3 3 3 3 2 2 2 2 2 1 2 1 2 2 2 1 1 1 2 2 2 2 2 2 1 1 2 3 2 2 2 2 2 1 1 1 1 2 1 2 1 1 0 1 2 3 2 2 1 1 1 2 2 1 0
1 2 3 3 4 5 6 5 4 4 3 4 2 2 1 1 3 3 4 2 2 1 2 2 3 3 4 3 3 1 1 0 2 3 5 5 6 6 4 3 3 4 4 3 3 3 3 3 3 3 4 4 4 4 3 3 2 3 ...

output:

XX.XXXX.XX.X..X.XXX...XX.XX.....XXXXXX.XX.X.X.XX..X.XX.XX..XXX.XX.X..X.X.X...XXX.X..XX.
..X.XXXX.X.X....X...X...X.X.X...X.XXXX..XX.X.X..XXXX.X...X...XX..XX...X....XX..X..X..XX
.X.X...X..XXX..XXX.XXX.XX...X.....XXX.X.X.X.X....X.X..X.X.XXX.X.XX...XX..XX...X.XX....X
..X.....X.X.XX.X.XX..X.XX...X...X......

result:

ok correct solution

Test #19:

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

input:

71 43
1 1 1 0 0 1 2 2 2 2 2 1 0 1 1 1 0 1 2 2 1 1 1 2 2 3 3 3 3 2 2 1 1 0 1 2 3 3 2 2 1 2 1 1 0
2 3 4 2 1 2 4 5 4 4 4 4 3 4 4 3 2 2 3 2 2 2 2 3 3 5 4 4 3 3 4 3 3 1 3 4 5 5 4 4 3 4 3 2 0
2 4 5 4 2 4 5 7 5 6 6 6 4 5 5 5 3 3 3 3 3 4 4 5 4 5 5 6 5 5 5 5 4 3 5 7 7 7 6 7 6 7 5 3 0
2 5 7 7 4 4 3 5 3 4 5 7 ...

output:

impossible

result:

ok impossible

Test #20:

score: -100
Wrong Answer
time: 1ms
memory: 4096kb

input:

69 2
0 1 1 1
1 2 2 1
2 3 3 1
2 2 2 0
2 3 3 1
2 3 3 1
3 5 5 2
3 5 5 2
2 5 5 3
1 4 4 3
0 3 3 3
0 2 2 2
1 2 2 1
1 2 2 1
2 3 3 1
2 3 3 1
2 3 3 1
2 3 3 1
1 2 2 1
2 3 3 1
2 3 3 1
2 4 4 2
1 2 2 1
1 3 3 2
2 4 4 2
3 5 5 2
3 5 5 2
3 4 4 1
2 3 3 1
1 1 1 0
1 1 1 0
1 2 2 1
1 2 2 1
0 1 1 1
0 1 1 1
0 1 1 1
0 2 2 2...

output:

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

result:

wrong answer expected impossible