QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#610547#7637. Exactly Three NeighborsYeyin_0WA 0ms3684kbC++141.0kb2024-10-04 16:25:282024-10-04 16:25:29

Judging History

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

  • [2024-10-04 16:25:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3684kb
  • [2024-10-04 16:25:28]
  • 提交

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 cout<<"-1 -1";
    }
}
/*
4 6
.####.
##..##
##..##
.####.
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 3

output:

1 6
#.##.#

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

-1 -1

result:

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