QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#399319#2540. Build The GridWindingWA 0ms3848kbC++17733b2024-04-26 10:13:212024-04-26 10:13:22

Judging History

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

  • [2024-04-26 10:13:22]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3848kb
  • [2024-04-26 10:13:21]
  • 提交

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, vector<char>(n, 'W'));

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

    for (int i = 0; i < n; i++) {
        for (int j = 0; 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: 0ms
memory: 3612kb

input:

3

output:

BWW
BBW
WWW

result:

ok accepted

Test #2:

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

input:

2

output:

BW
WW

result:

ok accepted

Test #3:

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

input:

4

output:

BWWW
BBWW
BBBW
WWWW

result:

wrong answer there are no white cells around a black cell