QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248202#7637. Exactly Three Neighborsjasonfan#RE 0ms3892kbC++202.0kb2023-11-11 17:51:492023-11-11 17:51:49

Judging History

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

  • [2023-11-11 17:51:49]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3892kb
  • [2023-11-11 17:51:49]
  • 提交

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;
            // }
            assert(0 == 1);
            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: 3824kb

input:

2 3

output:

3 1
#
#
.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1


result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

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

result:

ok good solution

Test #6:

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

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
Runtime Error

input:

7 9

output:


result: