QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#229470 | #7637. Exactly Three Neighbors | ucup-team1448# | AC ✓ | 0ms | 1620kb | C++14 | 871b | 2023-10-28 16:15:29 | 2023-10-28 16:15:30 |
Judging History
answer
#include <cstdio>
int main() {
int p, q;
scanf("%d%d", &p, &q);
if (p * 3 <= q * 2) {
int w = q * 2, c = p * 2;
printf("1 %d\n", w);
while (c) printf("##."), c -= 2, w -= 3;
while (w) putchar('.'), --w;
} else if (p == 5 && q == 7)
puts(R"(7 6
##..##
.####.
######
#....#
######
.####.
##..##)");
else if (p == 3 && q == 4)
puts(R"(4 4
..##
####
##..
####)");
else if (p == 7 && q == 9)
puts(R"(18 6
..####
###.##
#####.
#..###
####.#
.#####
##..##
#####.
#.####
###..#
.#####
##.###
####..
#.####
###.##
.####.
##.###
####.#)");
else if (p == 7 && q == 10)
puts(R"(5 4
.##.
####
#..#
####
.##.)");
else if (p == 4 && q == 5)
puts(R"(5 5
.####
##.##
####.
#.###
###.#)");
else
puts("-1 -1");
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 1516kb
input:
2 3
output:
1 6 ##.##.
result:
ok good solution
Test #2:
score: 0
Accepted
time: 0ms
memory: 1392kb
input:
1 1
output:
-1 -1
result:
ok no solution
Test #3:
score: 0
Accepted
time: 0ms
memory: 1380kb
input:
3 4
output:
4 4 ..## #### ##.. ####
result:
ok good solution
Test #4:
score: 0
Accepted
time: 0ms
memory: 1512kb
input:
3 5
output:
1 10 ##.##.##..
result:
ok good solution
Test #5:
score: 0
Accepted
time: 0ms
memory: 1380kb
input:
4 5
output:
5 5 .#### ##.## ####. #.### ###.#
result:
ok good solution
Test #6:
score: 0
Accepted
time: 0ms
memory: 1524kb
input:
7 10
output:
5 4 .##. #### #..# #### .##.
result:
ok good solution
Test #7:
score: 0
Accepted
time: 0ms
memory: 1388kb
input:
5 7
output:
7 6 ##..## .####. ###### #....# ###### .####. ##..##
result:
ok good solution
Test #8:
score: 0
Accepted
time: 0ms
memory: 1456kb
input:
7 9
output:
18 6 ..#### ###.## #####. #..### ####.# .##### ##..## #####. #.#### ###..# .##### ##.### ####.. #.#### ###.## .####. ##.### ####.#
result:
ok good solution
Test #9:
score: 0
Accepted
time: 0ms
memory: 1604kb
input:
0 1
output:
1 2 ..
result:
ok good solution
Test #10:
score: 0
Accepted
time: 0ms
memory: 1596kb
input:
1 2
output:
1 4 ##..
result:
ok good solution
Test #11:
score: 0
Accepted
time: 0ms
memory: 1572kb
input:
1 3
output:
1 6 ##....
result:
ok good solution
Test #12:
score: 0
Accepted
time: 0ms
memory: 1576kb
input:
1 4
output:
1 8 ##......
result:
ok good solution
Test #13:
score: 0
Accepted
time: 0ms
memory: 1512kb
input:
1 5
output:
1 10 ##........
result:
ok good solution
Test #14:
score: 0
Accepted
time: 0ms
memory: 1516kb
input:
1 6
output:
1 12 ##..........
result:
ok good solution
Test #15:
score: 0
Accepted
time: 0ms
memory: 1576kb
input:
1 7
output:
1 14 ##............
result:
ok good solution
Test #16:
score: 0
Accepted
time: 0ms
memory: 1620kb
input:
1 8
output:
1 16 ##..............
result:
ok good solution
Test #17:
score: 0
Accepted
time: 0ms
memory: 1576kb
input:
1 9
output:
1 18 ##................
result:
ok good solution
Test #18:
score: 0
Accepted
time: 0ms
memory: 1568kb
input:
1 10
output:
1 20 ##..................
result:
ok good solution
Test #19:
score: 0
Accepted
time: 0ms
memory: 1580kb
input:
2 5
output:
1 10 ##.##.....
result:
ok good solution
Test #20:
score: 0
Accepted
time: 0ms
memory: 1504kb
input:
2 7
output:
1 14 ##.##.........
result:
ok good solution
Test #21:
score: 0
Accepted
time: 0ms
memory: 1580kb
input:
2 9
output:
1 18 ##.##.............
result:
ok good solution
Test #22:
score: 0
Accepted
time: 0ms
memory: 1516kb
input:
3 7
output:
1 14 ##.##.##......
result:
ok good solution
Test #23:
score: 0
Accepted
time: 0ms
memory: 1508kb
input:
3 8
output:
1 16 ##.##.##........
result:
ok good solution
Test #24:
score: 0
Accepted
time: 0ms
memory: 1576kb
input:
3 10
output:
1 20 ##.##.##............
result:
ok good solution
Test #25:
score: 0
Accepted
time: 0ms
memory: 1548kb
input:
4 7
output:
1 14 ##.##.##.##...
result:
ok good solution
Test #26:
score: 0
Accepted
time: 0ms
memory: 1568kb
input:
4 9
output:
1 18 ##.##.##.##.......
result:
ok good solution
Test #27:
score: 0
Accepted
time: 0ms
memory: 1472kb
input:
5 6
output:
-1 -1
result:
ok no solution
Test #28:
score: 0
Accepted
time: 0ms
memory: 1500kb
input:
5 8
output:
1 16 ##.##.##.##.##..
result:
ok good solution
Test #29:
score: 0
Accepted
time: 0ms
memory: 1500kb
input:
5 9
output:
1 18 ##.##.##.##.##....
result:
ok good solution
Test #30:
score: 0
Accepted
time: 0ms
memory: 1412kb
input:
6 7
output:
-1 -1
result:
ok no solution
Test #31:
score: 0
Accepted
time: 0ms
memory: 1360kb
input:
7 8
output:
-1 -1
result:
ok no solution
Test #32:
score: 0
Accepted
time: 0ms
memory: 1320kb
input:
8 9
output:
-1 -1
result:
ok no solution
Test #33:
score: 0
Accepted
time: 0ms
memory: 1324kb
input:
9 10
output:
-1 -1
result:
ok no solution
Extra Test:
score: 0
Extra Test Passed