QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#241983#7637. Exactly Three NeighborsSolitaryDream#WA 0ms3620kbC++171.2kb2023-11-06 20:43:092023-11-06 20:43:09

Judging History

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

  • [2023-11-06 20:43:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3620kb
  • [2023-11-06 20:43:09]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i=(s),_t=(t); i<=_t; ++i)
typedef long long ll;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int p,q;
    cin >> p >> q;
    if(p*3<=q*2) {
        cout << 1 << ' ' << 2*q << '\n';
        FOR(i,1,p) {
            cout << "##.";
        }
        FOR(i,1,2*q-p*3) {
            cout << '.';
        }
        cout << '\n';
    } else if(p==3 && q==4) {
        cout << "4 4\n";
        cout << "####\n";
        cout << "##..\n";
        cout << "####\n";
        cout << "..##\n";
    } else if(p==7 && q==10) {
        cout << "4 5\n";
        cout << "####.\n";
        cout << "####.\n";
        cout << "#..##\n";
        cout << "#..##\n";
    } else if(p==4 && q==5) {
        cout << "5 5\n";
        cout << "####.\n";
        cout << "##.##\n";
        cout << ".####\n";
        cout << "###.#\n";
        cout << "#.###\n";
    } else if(p==5 && q==7) {
        cout << "6 7\n";
        cout << "######.\n";
        cout << "##..##.\n";
        cout << "##..##.\n";
        cout << "######.\n";
        cout << "#.##.##\n";
        cout << "#.##.##\n";
    } else {
        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: 3612kb

input:

2 3

output:

1 6
##.##.

result:

ok good solution

Test #2:

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

input:

1 1

output:

-1 -1

result:

ok no solution

Test #3:

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

input:

3 4

output:

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

result:

ok good solution

Test #4:

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

input:

3 5

output:

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

result:

ok good solution

Test #5:

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

input:

4 5

output:

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

result:

ok good solution

Test #6:

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

input:

7 10

output:

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

result:

ok good solution

Test #7:

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

input:

5 7

output:

6 7
######.
##..##.
##..##.
######.
#.##.##
#.##.##

result:

ok good solution

Test #8:

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

input:

7 9

output:

-1 -1

result:

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