QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#610831 | #7637. Exactly Three Neighbors | Yeyin_0 | WA | 1ms | 3732kb | C++14 | 2.1kb | 2024-10-04 17:38:41 | 2024-10-04 17:38:42 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for(int i=(a);i<=(b);i++)
#define LL long long
int q,p;
int main()
{
cin>>q>>p;
if(p==1&&q==1)
{
cout<<"-1 -1";
return 0;
}
if(q*3<=2*p)
{
cout<<"1 "<<2*p<<endl;
fo(i,1,3*q-3)
{
if(i%3==1||i%3==0)
{
cout<<"#";
}
else cout<<".";
}
cout<<"#";
fo(i,3*q-1,2*p-1) cout<<".";
cout<<"#";
}
else{
if(q==3&&p==4)
{
cout<<"4 4\n";
cout<<"#..#\n"
<<"####\n"
<<".##.\n"
<<"####\n";
}
else if(q==7&&p==10)
{
cout<<"5 4\n";
cout<<"#..#\n"
<<"####\n"
<<".##.\n"
<<".##.\n"
<<"####\n";
}
else if(q==4&&p==5)
{
cout<<"5 5\n";
cout<<"####.\n#.###\n###.#\n.####\n##.##\n";
}
else if(q==5&&p==7)
{
cout<<"14 14\n";
char ss[20]="....##########";
int o=0;
fo(i,0,13)
{
fo(j,0,13)
{
cout<<ss[(j-o+14)%14];
}
cout<<endl;
o=(o+5)%14;
}
}
else if(q==7&&p==9)
{
cout<<"18 6\n";
printf("#.####\n\
###..#\n\
.#####\n\
##.###\n\
####..\n\
#.####\n\
###.##\n\
.####.\n\
##.###\n\
####.#\n\
..####\n\
###.##\n\
#####.\n\
#..###\n\
####.#\n\
.#####\n\
##..##\n\
#####.\n");
}
else cout<<"-1 -1";
}
}
/*
####.
#.###
###.#
.####
##.##
14 14
....##########
#####....#####
##########....
#....#########
######....####
.##########...
18 6
#.####
###..#
.#####
##.###
####..
#.####
###.##
.####.
##.###
####.#
..####
###.##
#####.
#..###
####.#
.#####
##..##
#####.
#####..
##..###
#####..
#..####
####..#
*/
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3636kb
input:
2 3
output:
1 6 #.##.#
result:
ok good solution
Test #2:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
1 1
output:
-1 -1
result:
ok no solution
Test #3:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
3 4
output:
4 4 #..# #### .##. ####
result:
ok good solution
Test #4:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
3 5
output:
1 10 #.##.##..#
result:
ok good solution
Test #5:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
4 5
output:
5 5 ####. #.### ###.# .#### ##.##
result:
ok good solution
Test #6:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
7 10
output:
5 4 #..# #### .##. .##. ####
result:
ok good solution
Test #7:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
5 7
output:
14 14 ....########## #####....##### ##########.... #....######### ######....#### .##########... ##....######## #######....### ..##########.. ###....####### ########....## ...##########. ####....###### #########....#
result:
ok good solution
Test #8:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
7 9
output:
18 6 #.#### ###..# .##### ##.### ####.. #.#### ###.## .####. ##.### ####.# ..#### ###.## #####. #..### ####.# .##### ##..## #####.
result:
ok good solution
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
input:
0 1
output:
1 2 #...#
result:
wrong answer the width of each length must be 2, but read 5