QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#39931 | #993. 100 Boxes Per Hour... | AutumnKite | WA | 66ms | 3608kb | C++17 | 1.3kb | 2022-07-14 22:56:30 | 2022-07-14 22:56:30 |
Judging History
answer
#include <bits/stdc++.h>
const char name[] = "RGB";
int get() {
char c;
std::cin >> c;
return std::find(name, name + 3, c) - name;
}
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int T;
std::cin >> T;
while (T--) {
int A, B, C;
std::cin >> A >> B >> C;
if (100 - std::max({A, B, C}) >= 43) {
for (int i = 0; i < 100; ++i) {
int x = get();
if (x) {
std::cout << "PLACE " << x << std::endl;
} else {
std::cout << "DISCARD" << std::endl;
}
}
} else {
int cnt[3] = {};
int id[3] = {0, 1, 2};
for (int i = 0; i < 100; ++i) {
int x = get();
if (id[x]) {
std::cout << "PLACE " << id[x] << std::endl;
++cnt[x];
} else {
int ymin = (x + 1) % 3, ymax = (x + 2) % 3;
if (cnt[ymin] > cnt[ymax]) {
std::swap(ymin, ymax);
}
if (cnt[x] >= cnt[ymax]) {
std::cout << "EMPTY " << id[ymin] << std::endl;
cnt[ymin] = cnt[x] = 0;
std::swap(id[ymin], id[x]);
std::cout << "PLACE " << id[x] << std::endl;
++cnt[x];
} else {
std::cout << "DISCARD" << std::endl;
}
}
}
}
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 66ms
memory: 3608kb
input:
100 3 33 64 B G R R G R B R G R R B G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G R R G 84 8 8 B B B R R R R R G G G G G G G G B B B B B B B B B B B B R B B B B B B B B B B B B...
output:
PLACE 2 PLACE 1 DISCARD DISCARD PLACE 1 DISCARD PLACE 2 DISCARD PLACE 1 DISCARD DISCARD PLACE 2 PLACE 1 DISCARD DISCARD PLACE 1 DISCARD DISCARD PLACE 1 DISCARD DISCARD PLACE 1 DISCARD DISCARD PLACE 1 DISCARD DISCARD PLACE 1 DISCARD DISCARD PLACE 1 DISCARD DISCARD PLACE 1 DISCARD DISCARD PLACE 1 DISC...
result:
wrong answer Bad score