QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#447765#7637. Exactly Three NeighborsIratisWA 1ms4028kbC++141.1kb2024-06-18 19:42:362024-06-18 19:42:36

Judging History

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

  • [2024-06-18 19:42:36]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4028kb
  • [2024-06-18 19:42:36]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define md(a) a=(a%mod+mod)%mod
#define file(a) freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)

bool ST;

int p,q;
inline bool leq(int x,int y){return p*y<=q*x;}

bool ED;

signed main()
{
	int time_st=clock();
	cerr<<(&ST-&ED)/1024.0/1024<<endl;ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>p>>q;if(!leq(4,5)){cout<<"-1 -1";return 0;}
	if(leq(2,3))
	{
		if(p&1)p*=2,q*=2;int n=q,m=3;cout<<n<<' '<<m<<'\n';
		for(int i=1;i<=p/2*3;i++)
		{
			if(i%3==0)cout<<"...\n";
			else cout<<"###\n";
		}
		for(int i=p/2*3+1;i<=n;i++)cout<<"...\n";
		return 0;
	}
	if(p==3&&q==4)
	{
		cout<<"4 4\n";
		cout<<"####\n";
		cout<<"..##\n";
		cout<<"####\n";
		cout<<"##..\n";
		return 0;
	}
	if(p==4&&q==5)
	{
		cout<<"5 5\n";
		cout<<"#.###\n";
		cout<<"###.#\n";
		cout<<".####\n";
		cout<<"##.##\n";
		cout<<"####.\n";
		return 0;
	}
	if(p==7&&q==10)
	{
		cout<<"4 5\n";
		cout<<".###.\n";
		cout<<"##.##\n";
		cout<<"##.##\n";
		cout<<".###.\n";
		return 0;
	}
	cerr<<(clock()-time_st)/1e6<<endl;return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 3

output:

3 3
###
###
...

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

10 3
###
###
...
###
###
...
###
###
...
...

result:

ok good solution

Test #5:

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

input:

4 5

output:

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

result:

ok good solution

Test #6:

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

input:

7 10

output:

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

result:

ok good solution

Test #7:

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

input:

5 7

output:


result:

wrong output format Unexpected end of file - int32 expected