QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248023#7637. Exactly Three Neighborsjasonfan#WA 1ms3764kbC++201.6kb2023-11-11 17:05:062023-11-11 17:05:07

Judging History

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

  • [2023-11-11 17:05:07]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3764kb
  • [2023-11-11 17:05:06]
  • 提交

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) {
            puts("-1 -1"); // >>????
        } 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) {
            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: 3764kb

input:

2 3

output:

3 1
#
#
.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1


result:

ok no solution

Test #3:

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

input:

3 4

output:

4 4
.###
##.#
##.#
.###

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

5 5
###.#
.####
##.##
####.
#.###

result:

ok good solution

Test #6:

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

input:

7 10

output:

4 5
.###.
.###.
##.##
##.##

result:

ok good solution

Test #7:

score: -100
Wrong Answer
time: 0ms
memory: 3516kb

input:

5 7

output:

-1 -1

result:

wrong answer you didn't find a solution but jury did