QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#442616#7637. Exactly Three Neighborszwh2008WA 0ms3724kbC++14578b2024-06-15 13:01:322024-06-15 13:01:34

Judging History

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

  • [2024-06-15 13:01:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3724kb
  • [2024-06-15 13:01:32]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using pi=pair<int,int>;
#define fi first
#define se second
const int N=1e5+5;
int p,q;
int main() {
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
//	for(int p=0;p<=10;p++)for(int q=p;q<=10;q++)if(__gcd(p,q)==1&&3*p>2*q)cout<<p<<' '<<q<<'\n';
//	return 0;
	cin>>p>>q;
	if(p==1&&q==1)cout<<"-1 -1",exit(0);
	if(3*p<=2*q) {
		if(p&1)p*=2,q*=2;
		cout<<"1 "<<q<<'\n';
		for(int i=1;i<=p/2;i++)cout<<"##.";
		for(int i=1;i<=q-3*p/2;i++)cout<<'.';
		return 0;
	}
	cout<<"-1 -1\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 3

output:

1 3
##.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

-1 -1

result:

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