QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#229968#7637. Exactly Three Neighborsucup-team266#AC ✓1ms3500kbC++201.8kb2023-10-28 17:20:312023-10-28 17:20:32

Judging History

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

  • [2023-10-28 17:20:32]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3500kb
  • [2023-10-28 17:20:31]
  • 提交

answer

//Author: Kevin5307
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int a,b;
	cin>>a>>b;
	if(a==5&&b==7)
	{
		puts("14 14");
		puts("##########....\n#####....#####\n....##########\n#########....#\n####....######\n...##########.\n########....##\n###....#######\n..##########..\n#######....###\n##....########\n.##########...\n######....####\n#....#########");
		return 0;
	}
	if(a==7&&b==9)
	{
		puts("6 18");
		puts("#.##.####.####.###");
		puts("#.####.####.####.#");
		puts("###.####.####.##.#");
		puts(".####.####.##.####");
		puts("##.####.##.####.##");
		puts("####.##.####.####.");
		return 0;
	}
	if(a==7&&b==10)
	{
		puts("4 5");
		puts("#.###");
		puts("#.###");
		puts("###..");
		puts("###..");
		return 0;
	}
	if(a==3&&b==4)
	{
		puts("4 4");
		puts("..##");
		puts("####");
		puts("##..");
		puts("####");
		return 0;
	}
	if(a==4&&b==5)
	{
		puts("5 5");
		puts(".####");
		puts("##.##");
		puts("####.");
		puts("#.###");
		puts("###.#");
		return 0;
	}
	if(a*3>b*2)
		die("-1 -1");
	cout<<b*2<<" "<<1<<endl;
	for(int i=1;i<=b*2;i++)
		if((i-1)/3<a&&i%3)
			cout<<"#"<<endl;
		else
			cout<<"."<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 3

output:

6 1
#
#
.
#
#
.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

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

result:

ok good solution

Test #6:

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

input:

7 10

output:

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

result:

ok good solution

Test #7:

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

input:

5 7

output:

14 14
##########....
#####....#####
....##########
#########....#
####....######
...##########.
########....##
###....#######
..##########..
#######....###
##....########
.##########...
######....####
#....#########

result:

ok good solution

Test #8:

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

input:

7 9

output:

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

result:

ok good solution

Test #9:

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

input:

0 1

output:

2 1
.
.

result:

ok good solution

Test #10:

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

input:

1 2

output:

4 1
#
#
.
.

result:

ok good solution

Test #11:

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

input:

1 3

output:

6 1
#
#
.
.
.
.

result:

ok good solution

Test #12:

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

input:

1 4

output:

8 1
#
#
.
.
.
.
.
.

result:

ok good solution

Test #13:

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

input:

1 5

output:

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

result:

ok good solution

Test #14:

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

input:

1 6

output:

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

result:

ok good solution

Test #15:

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

input:

1 7

output:

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

result:

ok good solution

Test #16:

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

input:

1 8

output:

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

result:

ok good solution

Test #17:

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

input:

1 9

output:

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

result:

ok good solution

Test #18:

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

input:

1 10

output:

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

result:

ok good solution

Test #19:

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

input:

2 5

output:

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

result:

ok good solution

Test #20:

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

input:

2 7

output:

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

result:

ok good solution

Test #21:

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

input:

2 9

output:

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

result:

ok good solution

Test #22:

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

input:

3 7

output:

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

result:

ok good solution

Test #23:

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

input:

3 8

output:

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

result:

ok good solution

Test #24:

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

input:

3 10

output:

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

result:

ok good solution

Test #25:

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

input:

4 7

output:

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

result:

ok good solution

Test #26:

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

input:

4 9

output:

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

result:

ok good solution

Test #27:

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

input:

5 6

output:

-1 -1

result:

ok no solution

Test #28:

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

input:

5 8

output:

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

result:

ok good solution

Test #29:

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

input:

5 9

output:

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

result:

ok good solution

Test #30:

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

input:

6 7

output:

-1 -1

result:

ok no solution

Test #31:

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

input:

7 8

output:

-1 -1

result:

ok no solution

Test #32:

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

input:

8 9

output:

-1 -1

result:

ok no solution

Test #33:

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

input:

9 10

output:

-1 -1

result:

ok no solution

Extra Test:

score: 0
Extra Test Passed