QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#443645#7637. Exactly Three NeighborswdnmdwrnmmpWA 1ms3656kbC++20989b2024-06-15 16:11:222024-06-15 16:11:23

Judging History

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

  • [2024-06-15 16:11:23]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3656kb
  • [2024-06-15 16:11:22]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
// #define int long long
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef vector<int> vi;
typedef pair<int,int> pi;

const double eps=1e-9;
signed main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	
	int p,q; cin>>p>>q;
	if((double)p/q>0.75+eps){
		cout<<-1<<' '<<-1<<'\n';
	}
	else if((double)p/q<2.0/3+eps){
		int x=p, y=q*2-p*3;
		cout<<1<<' '<<q*2<<'\n';
		rep(i,1,x){
			cout<<"##.";
		}
		rep(i,1,y){
			cout<<".";
		}
		cout<<endl;
	}
	else if(p==5 && q==7){
		cout<<7<<' '<<6<<'\n';
		cout<<R"(..##..
#....#
......
.####.
......
#....#
..##.. )"<<endl;
	}
	else if(p==7 && q==10){
		cout<<4<<' '<<5<<'\n';
		cout<<R"(.###.
##.##
##.##
.###. )"<<endl;
	}
	else if(p==3 && q==4){
		cout<<4<<' '<<4<<'\n';
		cout<<R"(####
##..
####
..## )"<<endl;
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 3

output:

1 6
##.##.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

-1 -1

result:

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