QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#399360#2540. Build The GridWindingWA 1ms3652kbC++17992b2024-04-26 11:15:012024-04-26 11:15:02

Judging History

This is the latest submission verdict.

  • [2024-04-26 11:15:02]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3652kb
  • [2024-04-26 11:15:01]
  • Submitted

answer

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

using i64 = long long;

/*#ifndef ONLINE_JUDGE
#include "test.h"
#else
#define debug(...) 42
#define debug_assert(...) 42
#endif*/

void solve() {
    int n;
    cin >> n;

    vector<vector<char>> a(n + 1, vector<char>(n + 1, 'W'));

    int x = 0;

    for (int j = 1; j <= n; j += 2, x += 2) {
        for (int i = 2; i <= n - x; i++) {
            a[i][j] = 'B';
        }
    }

    x = 1;

    for (int i = n; i >= 1; i -= 2, x += 2) {
        for (int j = n - 1; j >= x; j--) {
            a[i][j] = 'B';
        }
    }

    a[n - 1][1] = a[n][2] = 'W';
    a[1][1] = a[n][n] = 'B';

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            cout << a[i][j];
        }
        cout << '\n';
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3560kb

input:

3

output:

BWW
WWW
BWB

result:

ok accepted

Test #2:

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

input:

2

output:

BW
BB

result:

wrong answer there are no white cells around a black cell