QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#399323 | #2540. Build The Grid | Winding | WA | 0ms | 3844kb | C++17 | 745b | 2024-04-26 10:19:15 | 2024-04-26 10:19:16 |
Judging History
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 = n - 1; j >= n - 1 - 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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3836kb
input:
3
output:
WWB WBB WWW
result:
ok accepted
Test #2:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
2
output:
WB WW
result:
ok accepted
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3644kb
input:
4
output:
WWWB WWBB WBBB WWWW
result:
wrong answer there are no white cells around a black cell