QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#681320#5731. CheckerboardfazlavarxWA 0ms3760kbC++231.4kb2024-10-27 05:08:392024-10-27 05:08:40

Judging History

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

  • [2024-10-27 05:08:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3760kb
  • [2024-10-27 05:08:39]
  • 提交

answer

#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int R, C, A, B;
    cin >> R >> C >> A >> B;

    vector<int> a_i;
    vector<int> b_i;
    int X = A;
    while(X--){
        int in;
        cin >> in;
        a_i.push_back(in);
    }
    X = B;
    while(X--){
        int in;
        cin >> in;
        b_i.push_back(in);
    }
    int EvenOrOdd = 0;
    int EvenOrOdd2 = 0;
    for (int i = 0; i < R; i++)
    {
        if (a_i.front() == 0)
        {
            a_i.erase(a_i.begin());
            EvenOrOdd2++;
        }
        vector<int> save = b_i;
        while (!save.empty())
        {
            if (save.front() == 0)
            {
                save.erase(save.begin());
                EvenOrOdd++;
            }
            else if (save.front() > 0)
            {
                if (EvenOrOdd2 % 2 == 0)
                {
                    if (EvenOrOdd % 2 == 0)
                        cout << "B";
                    else
                        cout << "W";
                }
                else
                {
                    if (EvenOrOdd % 2 == 0)
                        cout << "W";
                    else
                        cout << "B";
                }

                save.front()--;
            }
        }
        cout << endl;
        a_i.front()--;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3600kb

input:

6 5 3 2
1
2
3
3
2

output:

BBBWW
WWWBB
WWWBB
BBBWW
BBBWW
BBBWW

result:

ok 6 lines

Test #2:

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

input:

4 4 2 2
1
3
3
1

output:

BBBW
WWWB
WWWB
WWWB

result:

ok 4 lines

Test #3:

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

input:

20 20 4 14
5
2
9
4
1
2
1
1
1
1
1
1
1
1
1
1
4
3

output:

BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
WBBWBWBWBWBWBWWWWBBB
WBBWBWBWBWBWBWWWWBBB
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWBWBWBWBWBBBBWWW
BWWBWB...

result:

ok 20 lines

Test #4:

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

input:

50 2 43 2
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
3
1
2
1
1
1
1
3
1
1
1
1
1
1
1

output:

BW
WB
BW
BW
WB
BW
WB
BW
WB
BW
WB
BW
WB
BW
WB
BW
WB
BW
WB
BW
WB
BW
WB
BW
WB
BW
BW
WB
BW
WB
BW
WB
BW
BW
BW
WB
BW
BW
WB
BW
WB
BW
WB
WB
WB
BW
WB
BW
WB
BW

result:

ok 50 lines

Test #5:

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

input:

1 50 1 5
1
1
10
11
22
6

output:

BWWWWWWWWWWBBBBBBBBBBBWWWWWWWWWWWWWWWWWWWWWWBBBBBB

result:

ok single line: 'BWWWWWWWWWWBBBBBBBBBBBWWWWWWWWWWWWWWWWWWWWWWBBBBBB'

Test #6:

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

input:

50 1 17 1
4
1
1
1
6
2
3
1
3
5
1
4
5
1
6
2
4
1

output:

B
W
B
W
W
W
W
W
B
W
B
W
B
B
W
W
B
W
W
W
B
W
W
B
W
B
W
W
W
B
W
B
B
W
B
W
B
B
B
W
B
W
B
W
W
B
B
W
B
W

result:

wrong answer 2nd lines differ - expected: 'B', found: 'W'