QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#617089 | #8287. Caught in the Middle | pengpeng_fudan# | WA | 1ms | 3728kb | C++23 | 637b | 2024-10-06 13:51:24 | 2024-10-06 13:51:25 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int T;
int n;
char s[N];
bool check() {
for (int i = 1; i <= n; ++i) {
if (s[i] == s[n - i + 1]) {
return 0;
}
}
return 1;
}
void solve() {
scanf("%d", &n);
scanf("%s", s + 1);
if (s[1] == 'L' || s[n] == 'R') {
puts("Alice");
return ;
}
if (check()) {
puts("Bob");
return ;
}
else {
puts("Alice");
return ;
}
}
int main() {
scanf("%d", &T);
while (T--) {
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3660kb
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:
Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Bob Alice Alice Alice
result:
ok 20 lines
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3728kb
input:
20 7 LRLLRRR 8 LRLRLRRR 3 RLL 10 RLRLRLRLRL 10 RLRLRLRLRL 6 RLLLRL 10 RLRLRLRLLL 5 RLRRR 2 LL 10 RRRRLRLRLL 7 LLRRLLR 3 LRR 10 RRRRRLLLLL 10 RLRRRLRLRR 2 LR 6 RRLLLL 4 RRLR 10 LRLRLLRLRR 4 LRLL 10 RRLLRRRLLL
output:
Alice Alice Alice Bob Bob Alice Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice Alice Alice Alice Alice
result:
wrong answer 20th lines differ - expected: 'Bob', found: 'Alice'