QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#610905#7637. Exactly Three NeighborswyhaoWA 0ms3948kbC++143.1kb2024-10-04 18:00:162024-10-04 18:00:21

Judging History

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

  • [2024-10-04 18:00:21]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3948kb
  • [2024-10-04 18:00:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int p,q;
int main(){
    scanf("%d%d",&p,&q);
    if(p==0){
        puts("1 1");
        puts(".");
        return 0;
    }
    if(p==1){
        if(q==1){
            puts("-1 -1");
            return 0;
        }
        printf("%d %d\n",1,2*q);
        printf("##..");
        for(int k=3;k<=q;k++) printf("..");
        return 0;
    }
    if(p==2){
        printf("%d %d\n",1,q);
        printf("##");
        for(int k=3;k<=q;k++) printf(".");
        return 0;
    }
    if(p==3){
        if(q<=4){
            puts("4 4");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            return 0;
        }
        printf("%d %d\n",1,2*q);
        printf("##.##.##..");
        for(int k=6;k<=q;k++) printf("..");
        return 0;
    }
    if(p==4){
        if(q<=5){
            puts("5 5");
            puts(".####");
            puts("##.##");
            puts("####.");
            puts("#.###");
            puts("###.#");
            return 0;
        }
        printf("%d %d\n",1,q);
        printf("##.##.");
        for(int k=7;k<=q;k++) printf(".");
        return 0;
    }
    if(p==5){
        if(q<=7){
            puts("28 4");
            puts("##..");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("##..");
            puts("##..");
            return 0;
        }
        printf("%d %d\n",1,2*q);
        printf("##.##.##.##.##..");
        for(int k=9;k<=q;k++) printf("..");
        return 0;
    }
    if(p==7 and q==10){
            puts("20 4");
            puts("##..");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("####");
            puts("..##");
            puts("####");
            puts("##..");
            puts("##..");
            puts("##..");
        return 0;
    }
    if(p==7 and q==9){
        puts("6 18");
        puts(".####.##.####.####");
        puts("###.####.##.####.#");
        puts("#.####.####.##.###");
        puts("####.####.####.##.");
        puts("##.####.####.####.");
        puts("##.##.####.####.##");
        return 0;
    }
    printf("-1 -1");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3872kb

input:

2 3

output:

1 3
##.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

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

result:

ok good solution

Test #6:

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

input:

7 10

output:

20 4
##..
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
##..
##..

result:

ok good solution

Test #7:

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

input:

5 7

output:

28 4
##..
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
##..
##..

result:

ok good solution

Test #8:

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

input:

7 9

output:

6 18
.####.##.####.####
###.####.##.####.#
#.####.####.##.###
####.####.####.##.
##.####.####.####.
##.##.####.####.##

result:

ok good solution

Test #9:

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

input:

0 1

output:

1 1
.

result:

ok good solution

Test #10:

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

input:

1 2

output:

1 4
##..

result:

ok good solution

Test #11:

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

input:

1 3

output:

1 6
##....

result:

ok good solution

Test #12:

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

input:

1 4

output:

1 8
##......

result:

ok good solution

Test #13:

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

input:

1 5

output:

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

result:

ok good solution

Test #14:

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

input:

1 6

output:

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

result:

ok good solution

Test #15:

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

input:

1 7

output:

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

result:

ok good solution

Test #16:

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

input:

1 8

output:

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

result:

ok good solution

Test #17:

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

input:

1 9

output:

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

result:

ok good solution

Test #18:

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

input:

1 10

output:

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

result:

ok good solution

Test #19:

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

input:

2 5

output:

1 5
##...

result:

ok good solution

Test #20:

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

input:

2 7

output:

1 7
##.....

result:

ok good solution

Test #21:

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

input:

2 9

output:

1 9
##.......

result:

ok good solution

Test #22:

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

input:

3 7

output:

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

result:

ok good solution

Test #23:

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

input:

3 8

output:

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

result:

ok good solution

Test #24:

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

input:

3 10

output:

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

result:

ok good solution

Test #25:

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

input:

4 7

output:

1 7
##.##..

result:

ok good solution

Test #26:

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

input:

4 9

output:

1 9
##.##....

result:

ok good solution

Test #27:

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

input:

5 6

output:

28 4
##..
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
####
..##
####
##..
##..
##..

result:

wrong answer the total share of black squares must be 5/6, but your plan is 5/7