QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#631785 | #8287. Caught in the Middle | DBsoleil# | WA | 1ms | 3592kb | C++23 | 443b | 2024-10-12 10:16:30 | 2024-10-12 10:16:35 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main(void) {
cin.tie(nullptr)->sync_with_stdio(false);
int tests;
cin >> tests;
while (tests--) {
int n, c = 0, ans = 1; cin >> n;
string s; cin >> s;
ans &= (c == 0);
for (int i = 0; i < n; ++i) {
c += (s[i] == 'R') - (s[i] == 'L');
ans &= (c >= 0);
}
cout << (ans == 1 ? "Bob" : "Alice") << endl;
}
return 0;
} // main
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3592kb
input:
20 10 RLRRRRLLRR 10 LRLLLLRRLR 6 RLRLRL 10 LLRLRRRRLR 6 LRRLLL 3 RLR 5 LLRRR 6 RRRRRL 9 LRRRLRRLR 1 R 10 RRRLLRRLLL 6 LRLLLR 9 LLRLRLRLR 7 RRRRLRR 2 LL 10 RRRLLRRLRR 2 RL 7 RRLRRLR 3 LLR 10 LLRLRRRLLR
output:
Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Bob Alice Alice Bob Alice Bob Bob Bob Alice Alice
result:
wrong answer 1st lines differ - expected: 'Alice', found: 'Bob'