QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#524554#7637. Exactly Three NeighborsJohnAlfnovWA 0ms3912kbC++14573b2024-08-19 19:38:292024-08-19 19:38:30

Judging History

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

  • [2024-08-19 19:38:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3912kb
  • [2024-08-19 19:38:29]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

int main(){
	int p,q;
	scanf("%d%d",&p,&q);
	if(3*p<=2*q){
		if(p%2)p*=2,q*=2;
		printf("%d %d\n",1,q);
		for(int i=1;i<=q;++i){
			if(i%3!=0&&p)putchar('#'),--p;
			else putchar('.');
		}
		putchar('\n');
		return 0;
	}
	if(p==3&&q==4){
		puts("4 4");
		puts("..##");
		puts("####");
		puts("##..");
		puts("####");
		return 0;
	}
	if(p==4&&q==5){
		puts("5 5");
		puts(".####");
		puts("##.##");
		puts("####.");
		puts("#.###");
		puts("###.#");
		return 0;
	}
	puts("-1 -1");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 3

output:

1 3
##.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

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

result:

ok good solution

Test #6:

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

input:

7 10

output:

-1 -1

result:

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