QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#681334 | #5731. Checkerboard | fazlavarx | WA | 0ms | 3636kb | C++23 | 2.2kb | 2024-10-27 05:30:41 | 2024-10-27 05:30:42 |
Judging History
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);
}
// R = 50, C = 1, A = 17, B = 1;
// a_i.push_back(4);
// a_i.push_back(1);
// a_i.push_back(1);
// a_i.push_back(1);
// a_i.push_back(6);
// a_i.push_back(2);
// a_i.push_back(3);
// a_i.push_back(1);
// a_i.push_back(3);
// a_i.push_back(5);
// a_i.push_back(1);
// a_i.push_back(4);
// a_i.push_back(5);
// a_i.push_back(1);
// a_i.push_back(6);
// a_i.push_back(2);
// a_i.push_back(4);
// a_i.push_back(1);
// b_i.push_back(1);
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;
if (b_i.front() == 1 && b_i.size() == 1){
if(EvenOrOdd2 % 2 == 0)
cout << "B";
else
cout << "W";
}
else{
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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3552kb
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: 3532kb
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: 3540kb
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: 3636kb
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: 3480kb
input:
1 50 1 5 1 1 10 11 22 6
output:
BWWWWWWWWWWBBBBBBBBBBBWWWWWWWWWWWWWWWWWWWWWWBBBBBB
result:
ok single line: 'BWWWWWWWWWWBBBBBBBBBBBWWWWWWWWWWWWWWWWWWWWWWBBBBBB'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3572kb
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 B B B W B W B B B B B B W W B B B W B B B W W W W W B W W W W B B B B B W B B B B B B W W B B B B
result:
ok 50 lines
Test #7:
score: -100
Wrong Answer
time: 0ms
memory: 3532kb
input:
2 50 2 3 1 1 14 18 18
output:
BBBBBBBBBBBBBBWWWWWWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBWWWWWWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBB
result:
wrong answer 2nd lines differ - expected: 'WWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBBWWWWWWWWWWWWWWWWWW', found: 'BBBBBBBBBBBBBBWWWWWWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBB'