QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#432184 | #6644. Red Black Grid | ucup-team3215 | WA | 0ms | 3468kb | C++20 | 587b | 2024-06-06 21:41:52 | 2024-06-06 21:41:53 |
Judging History
answer
#include <iostream>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
for (int tc = (cin >> tc, tc); tc--; ) {
int n, k; cin >> n >> k;
string s(n * n, 'R');
for (int i = 0, t = n == 3 && k % 2 && k < 11; i < n; ++i)
for (int j = (i + (t && i != n - 1)) % 2; j < n; j += 2) {
int cur = 4 - (!i || i == n - 1) - (!j || j == n - 1);
if (k >= cur && k - cur != 1) s[i * n + j] = 'B', k -= cur;
}
if (!k)
for (int i = 0; i < n; ++i) cout << s.substr(i * n, n) << '\n';
else cout << "Impossible\n";
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3468kb
input:
2 3 6 3 1
output:
BRB RRR BRR Impossible
result:
wrong answer Condition failed: "A == B" (test case 1)