QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#626388#5731. CheckerboardRebukedWA 0ms3476kbC++201.3kb2024-10-10 07:43:332024-10-10 07:43:34

Judging History

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

  • [2024-10-10 07:43:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3476kb
  • [2024-10-10 07:43:33]
  • 提交

answer

// Online C++ compiler to run C++ program online
#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main() {
    int R,C,A,B;
    cin >> R >> C >> A >> B;
    vector<int> a(R);
    vector<int> b(C);
    vector<vector<char>> ans(R, vector<char> (C));
    for(int i = 0; i < A; ++i) cin >> a[i];
    for(int i = 0; i < B; ++i) cin >> b[i];
    bool x = false;
    int AC = 0;
    int BC = 0;
    int HORZ = b[BC];
    int VERT = a[AC];
    for(int i = 0; i < R; ++i) {
        if(VERT == 0) {
            x = !x;
            ++AC;
            VERT = a[AC];
        }
        for(int j = 0; j < C; ++j) {
            if(HORZ == 0) {
                x = !x;
                ++BC;
                HORZ = b[BC];
            }
            --HORZ;
            if(!x) {
                ans[i][j] = 'B';
            }
            if(x) {
                ans[i][j] = 'W';
            }
            
            if(j == C-1)  {
                BC = 0;
                HORZ = b[BC];
                if(b.size()%2 == 0) x = !x;
            }
        }
        --VERT;
    }
    for(int i = 0; i < R; ++i) {
        for(int j = 0; j < C; ++j) {
            cout << ans[i][j];
        }
        cout << endl;
    }

    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3476kb

input:

6 5 3 2
1
2
3
3
2

output:

BBBWW
BBBWW
WWWBB
WWWBB
BBBWW
WWWBB

result:

wrong answer 2nd lines differ - expected: 'WWWBB', found: 'BBBWW'