QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#446110#7637. Exactly Three Neighbors_l_l_WA 1ms3824kbC++141.3kb2024-06-16 21:36:372024-06-16 21:36:37

Judging History

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

  • [2024-06-16 21:36:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3824kb
  • [2024-06-16 21:36:37]
  • 提交

answer

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3812kb

input:

2 3

output:

1 6
.##.##

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

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

result:

ok good solution

Test #6:

score: -100
Wrong Answer
time: 1ms
memory: 3752kb

input:

7 10

output:

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

result:

wrong answer the total share of black squares must be 7/10, but your plan is 13/18