QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#248198 | #7637. Exactly Three Neighbors | jasonfan# | WA | 0ms | 3956kb | C++20 | 1.9kb | 2023-11-11 17:51:22 | 2023-11-11 17:51:22 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int p, q;
cin >> p >> q;
if (5 * p > 4 * q) {
puts("-1 -1\n");
} else if (p == 1) {
printf("%d 1\n", q * 2);
for (int i = 1; i <= q * 2; ++i) putchar(i <= 2 ? '#' : '.'), putchar('\n');
} else if (p == 2) {
printf("%d 1\n", q);
for (int i = 1; i <= q; ++i) putchar(i <= 2 ? '#' : '.'), putchar('\n');
} else if (p == 3) {
if (q == 4) {
printf("4 4\n.###\n##.#\n##.#\n.###\n");
} else {
printf("%d 1\n", q * 2);
for (int i = 1; i <= q * 2; ++i) {
putchar((i <= 9 && i % 3 != 1) ? '#' : '.');
putchar('\n');
}
}
} else if (p == 4) {
if (q == 5) {
printf("5 5\n###.#\n.####\n##.##\n####.\n#.###\n");
} else {
printf("%d 1\n", q);
for (int i = 1; i <= q; ++i) {
putchar((i <= 6 && i % 3 != 1) ? '#' : '.');
putchar('\n');
}
}
} else if (p == 5) {
if (q == 7) {
// assert(0 == 1);
// puts("-1 -1"); // >>????
puts("4 14");
puts("###..###..###.");
puts("#.####.####.##");
puts("#.####.####.##");
puts("###..###..###.");
} else {
printf("%d 1\n", q * 2);
for (int i = 1; i <= q * 2; ++i) {
putchar((i <= 15 && i % 3 != 1) ? '#' : '.');
putchar('\n');
}
}
} else if (p == 7) {
if (q == 9) {
// while (1) {
// cerr << "fuck you" << endl;
// }
puts("-1 -1"); // >>????
} else {
// 7/10
printf("4 5\n.###.\n.###.\n##.##\n##.##\n");
}
} else {
cerr << "fuck?" << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3844kb
input:
2 3
output:
3 1 # # .
result:
ok good solution
Test #2:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1 1
output:
-1 -1
result:
ok no solution
Test #3:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
3 4
output:
4 4 .### ##.# ##.# .###
result:
ok good solution
Test #4:
score: 0
Accepted
time: 0ms
memory: 3956kb
input:
3 5
output:
10 1 . # # . # # . # # .
result:
ok good solution
Test #5:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
4 5
output:
5 5 ###.# .#### ##.## ####. #.###
result:
ok good solution
Test #6:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
7 10
output:
4 5 .###. .###. ##.## ##.##
result:
ok good solution
Test #7:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
5 7
output:
4 14 ###..###..###. #.####.####.## #.####.####.## ###..###..###.
result:
ok good solution
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3560kb
input:
7 9
output:
-1 -1
result:
wrong answer you didn't find a solution but jury did