QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#526912#2553. BingobobbilykingWA 0ms3704kbC++201.5kb2024-08-22 01:26:272024-08-22 01:26:28

Judging History

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

  • [2024-08-22 01:26:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3704kb
  • [2024-08-22 01:26:27]
  • 提交

answer


#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <vector>
#pragma GCC target ("avx2")

#include<bits/stdc++.h>
#include<math.h>
using namespace std;

typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> pl;
typedef vector<ll> vl;
#define FD(i, r, l) for(ll i = r; i > (l); --i)

#define K first
#define V second
#define G(x) ll x; cin >> x;
#define GD(x) ld x; cin >> x;
#define GS(s) string s; cin >> s;
#define EX(x) { cout << x << '\n'; exit(0); }
#define A(a) (a).begin(), (a).end()
#define F(i, l, r) for (ll i = l; i < (r); ++i)

template<typename A, typename B>
A& chmax(A &a, B b) { return a < b ? (a=b): a; }

template<typename A, typename B>
A& chmin(A &a, B b) { return a > b ? (a=b): a; }




const ll N = 1;
const ll M = 1000000007; // 998244353


int main(){
//    freopen("a.in", "r", stdin);
//    freopen("a.out", "w", stdout);

    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(20);

    G(n) G(k)
    ll thresh = n * n - n;
    if (n % 2 == 0) thresh--;
    
    if (k > thresh) {
        cout << "NO\n";
    }     else {
        cout << "YES\n";
        F(i, 0, n) {
            F(j, 0, n) {
                bool ok = i != j;
                if (n % 2 == 0) ok &= !(i == 0 and j == 3);
                ok &= k > 0;
                if (ok) {
                    k--; cout << "#";
                } else cout << ".";
            }
            cout << '\n';
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4 2

output:

YES
.##.
....
....
....

result:

ok n=4, k=2

Test #2:

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

input:

4 16

output:

NO

result:

ok n=4, k=16

Test #3:

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

input:

2 0

output:

YES
..
..

result:

ok n=2, k=0

Test #4:

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

input:

3 0

output:

YES
...
...
...

result:

ok n=3, k=0

Test #5:

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

input:

3 2

output:

YES
.##
...
...

result:

ok n=3, k=2

Test #6:

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

input:

5 4

output:

YES
.####
.....
.....
.....
.....

result:

ok n=5, k=4

Test #7:

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

input:

25 20

output:

YES
.####################....
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.............

result:

ok n=25, k=20

Test #8:

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

input:

31 29

output:

YES
.#############################.
...............................
...............................
...............................
...............................
...............................
...............................
...............................
...............................
...........

result:

ok n=31, k=29

Test #9:

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

input:

44 10

output:

YES
.##.########................................
............................................
............................................
............................................
............................................
............................................
.............................

result:

ok n=44, k=10

Test #10:

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

input:

44 22

output:

YES
.##.####################....................
............................................
............................................
............................................
............................................
............................................
.............................

result:

ok n=44, k=22

Test #11:

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

input:

100 0

output:

YES
....................................................................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=0

Test #12:

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

input:

100 1

output:

YES
.#..................................................................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=1

Test #13:

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

input:

100 2

output:

YES
.##.................................................................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=2

Test #14:

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

input:

100 50

output:

YES
.##.################################################................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=50

Test #15:

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

input:

100 98

output:

YES
.##.################################################################################################
....................................................................................................
.................................................................................................

result:

ok n=100, k=98

Test #16:

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

input:

100 99

output:

YES
.##.################################################################################################
#...................................................................................................
.................................................................................................

result:

ok n=100, k=99

Test #17:

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

input:

99 97

output:

YES
.#################################################################################################.
...................................................................................................
...................................................................................................

result:

ok n=99, k=97

Test #18:

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

input:

99 98

output:

YES
.##################################################################################################
...................................................................................................
...................................................................................................

result:

ok n=99, k=98

Test #19:

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

input:

1 0

output:

YES
.

result:

ok n=1, k=0

Test #20:

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

input:

1 1

output:

NO

result:

ok n=1, k=1

Test #21:

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

input:

2 0

output:

YES
..
..

result:

ok n=2, k=0

Test #22:

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

input:

2 1

output:

YES
.#
..

result:

ok n=2, k=1

Test #23:

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

input:

2 2

output:

NO

result:

ok n=2, k=2

Test #24:

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

input:

2 3

output:

NO

result:

ok n=2, k=3

Test #25:

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

input:

2 4

output:

NO

result:

ok n=2, k=4

Test #26:

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

input:

3 0

output:

YES
...
...
...

result:

ok n=3, k=0

Test #27:

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

input:

3 1

output:

YES
.#.
...
...

result:

ok n=3, k=1

Test #28:

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

input:

3 3

output:

YES
.##
#..
...

result:

ok n=3, k=3

Test #29:

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

input:

3 5

output:

YES
.##
#.#
#..

result:

ok n=3, k=5

Test #30:

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

input:

3 6

output:

YES
.##
#.#
##.

result:

ok n=3, k=6

Test #31:

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

input:

3 7

output:

NO

result:

ok n=3, k=7

Test #32:

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

input:

3 8

output:

NO

result:

ok n=3, k=8

Test #33:

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

input:

3 9

output:

NO

result:

ok n=3, k=9

Test #34:

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

input:

4 0

output:

YES
....
....
....
....

result:

ok n=4, k=0

Test #35:

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

input:

4 3

output:

YES
.##.
#...
....
....

result:

ok n=4, k=3

Test #36:

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

input:

4 4

output:

YES
.##.
#.#.
....
....

result:

ok n=4, k=4

Test #37:

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

input:

4 5

output:

YES
.##.
#.##
....
....

result:

ok n=4, k=5

Test #38:

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

input:

4 16

output:

NO

result:

ok n=4, k=16

Test #39:

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

input:

4 9

output:

YES
.##.
#.##
##.#
#...

result:

ok n=4, k=9

Test #40:

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

input:

4 10

output:

YES
.##.
#.##
##.#
##..

result:

ok n=4, k=10

Test #41:

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

input:

4 12

output:

NO

result:

wrong answer YES/NO differs