QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#432184#6644. Red Black Griducup-team3215WA 0ms3468kbC++20587b2024-06-06 21:41:522024-06-06 21:41:53

Judging History

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

  • [2024-06-06 21:41:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3468kb
  • [2024-06-06 21:41:52]
  • 提交

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)