QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#231040#7637. Exactly Three Neighborsucup-team1951#AC ✓15ms9204kbPython31.3kb2023-10-28 23:48:522023-10-28 23:48:52

Judging History

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

  • [2023-10-28 23:48:52]
  • 评测
  • 测评结果:AC
  • 用时:15ms
  • 内存:9204kb
  • [2023-10-28 23:48:52]
  • 提交

answer

p, q = map(int, input().split())

if p * 3 <= q * 2:
    a = ".##" * p
    a += "." * (2 * q - len(a))
    print(1, len(a))
    print(a)
    exit()

if (p, q) == (5, 7):
    print(14, 10)
    print("""#..##.##.#
#..##.##.#
#..##.##.#
#####.##.#
.##.######
.##.##..##
.##.######
#####.##.#
#..##.##.#
#####.##.#
.##.######
.##.##..##
.##.######
#####.##.#""")
elif (p, q) == (3, 4):
    print(8, 16)
    print("""##..##..##..##..
################
..##..##..##..##
################
##..##..##..##..
################
..##..##..##..##
################""")
elif (p, q) == (4, 5):
    print(5, 15)
    print("""#.####.####.###
###.####.####.#
.####.####.####
##.####.####.##
####.####.####.""")
elif (p, q) == (7, 9):
    print(18, 12)
    print(""".#####.#####
###..####..#
#.#####.####
#####.#####.
##..####..##
.#####.#####
####.#####.#
#..####..###
#####.#####.
###.#####.##
..####..####
####.#####.#
##.#####.###
.####..####.
###.#####.##
#.#####.####
####..####..
##.#####.###""")
elif (p, q) == (7, 10):
    print(12, 10)
    print("""##########
####..##..
#..#######
######..##
.##..####.
##########
#..##....#
#..##....#
#..#######
####.####.
######..##
....##..##
""")
else:
    print(-1, -1)
    
    

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 10ms
memory: 9076kb

input:

2 3

output:

1 6
.##.##

result:

ok good solution

Test #2:

score: 0
Accepted
time: 9ms
memory: 9112kb

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

score: 0
Accepted
time: 9ms
memory: 8988kb

input:

3 4

output:

8 16
##..##..##..##..
################
..##..##..##..##
################
##..##..##..##..
################
..##..##..##..##
################

result:

ok good solution

Test #4:

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

input:

3 5

output:

1 10
.##.##.##.

result:

ok good solution

Test #5:

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

input:

4 5

output:

5 15
#.####.####.###
###.####.####.#
.####.####.####
##.####.####.##
####.####.####.

result:

ok good solution

Test #6:

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

input:

7 10

output:

12 10
##########
####..##..
#..#######
######..##
.##..####.
##########
#..##....#
#..##....#
#..#######
####.####.
######..##
....##..##


result:

ok good solution

Test #7:

score: 0
Accepted
time: 6ms
memory: 9168kb

input:

5 7

output:

14 10
#..##.##.#
#..##.##.#
#..##.##.#
#####.##.#
.##.######
.##.##..##
.##.######
#####.##.#
#..##.##.#
#####.##.#
.##.######
.##.##..##
.##.######
#####.##.#

result:

ok good solution

Test #8:

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

input:

7 9

output:

18 12
.#####.#####
###..####..#
#.#####.####
#####.#####.
##..####..##
.#####.#####
####.#####.#
#..####..###
#####.#####.
###.#####.##
..####..####
####.#####.#
##.#####.###
.####..####.
###.#####.##
#.#####.####
####..####..
##.#####.###

result:

ok good solution

Test #9:

score: 0
Accepted
time: 14ms
memory: 9164kb

input:

0 1

output:

1 2
..

result:

ok good solution

Test #10:

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

input:

1 2

output:

1 4
.##.

result:

ok good solution

Test #11:

score: 0
Accepted
time: 15ms
memory: 9028kb

input:

1 3

output:

1 6
.##...

result:

ok good solution

Test #12:

score: 0
Accepted
time: 15ms
memory: 9032kb

input:

1 4

output:

1 8
.##.....

result:

ok good solution

Test #13:

score: 0
Accepted
time: 14ms
memory: 9028kb

input:

1 5

output:

1 10
.##.......

result:

ok good solution

Test #14:

score: 0
Accepted
time: 10ms
memory: 9072kb

input:

1 6

output:

1 12
.##.........

result:

ok good solution

Test #15:

score: 0
Accepted
time: 14ms
memory: 9036kb

input:

1 7

output:

1 14
.##...........

result:

ok good solution

Test #16:

score: 0
Accepted
time: 9ms
memory: 9044kb

input:

1 8

output:

1 16
.##.............

result:

ok good solution

Test #17:

score: 0
Accepted
time: 14ms
memory: 9072kb

input:

1 9

output:

1 18
.##...............

result:

ok good solution

Test #18:

score: 0
Accepted
time: 14ms
memory: 9040kb

input:

1 10

output:

1 20
.##.................

result:

ok good solution

Test #19:

score: 0
Accepted
time: 7ms
memory: 9108kb

input:

2 5

output:

1 10
.##.##....

result:

ok good solution

Test #20:

score: 0
Accepted
time: 14ms
memory: 9204kb

input:

2 7

output:

1 14
.##.##........

result:

ok good solution

Test #21:

score: 0
Accepted
time: 10ms
memory: 9068kb

input:

2 9

output:

1 18
.##.##............

result:

ok good solution

Test #22:

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

input:

3 7

output:

1 14
.##.##.##.....

result:

ok good solution

Test #23:

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

input:

3 8

output:

1 16
.##.##.##.......

result:

ok good solution

Test #24:

score: 0
Accepted
time: 7ms
memory: 9096kb

input:

3 10

output:

1 20
.##.##.##...........

result:

ok good solution

Test #25:

score: 0
Accepted
time: 10ms
memory: 9160kb

input:

4 7

output:

1 14
.##.##.##.##..

result:

ok good solution

Test #26:

score: 0
Accepted
time: 10ms
memory: 9028kb

input:

4 9

output:

1 18
.##.##.##.##......

result:

ok good solution

Test #27:

score: 0
Accepted
time: 14ms
memory: 9040kb

input:

5 6

output:

-1 -1

result:

ok no solution

Test #28:

score: 0
Accepted
time: 10ms
memory: 9068kb

input:

5 8

output:

1 16
.##.##.##.##.##.

result:

ok good solution

Test #29:

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

input:

5 9

output:

1 18
.##.##.##.##.##...

result:

ok good solution

Test #30:

score: 0
Accepted
time: 14ms
memory: 9076kb

input:

6 7

output:

-1 -1

result:

ok no solution

Test #31:

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

input:

7 8

output:

-1 -1

result:

ok no solution

Test #32:

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

input:

8 9

output:

-1 -1

result:

ok no solution

Test #33:

score: 0
Accepted
time: 9ms
memory: 9092kb

input:

9 10

output:

-1 -1

result:

ok no solution

Extra Test:

score: 0
Extra Test Passed