QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#684966#8287. Caught in the MiddleJoyeuse_Ordre#WA 0ms1352kbC++14513b2024-10-28 16:50:002024-10-28 16:50:01

Judging History

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

  • [2024-10-28 16:50:01]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:1352kb
  • [2024-10-28 16:50:00]
  • 提交

answer

#include<cstdio>
const int MAXN = 1e6 + 5;
char S[MAXN];
void solve(){
    int n; scanf("%d", &n);
    for(int i=1;i<=n;i++) scanf("\n%c",S+i);
    S[n + 1] = '\0';
    int begin = 1, end = n, totL = 0, totR = 0;
    while(S[begin] == 'R' && begin <= n) ++begin, ++totL;
    while(S[end] == 'L' && end >= 1) --end, ++totR;
    puts((totL + totR & 1) || totL + totR <= 1 || totL == n || totR == n ? "Alice" : "Bob");
}
int main(){
    int T; scanf("%d", &T);
    while(T--) solve();
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 1352kb

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
Bob
Alice
Alice
Bob
Alice
Alice
Bob
Alice
Alice
Bob
Bob
Alice
Alice

result:

wrong answer 8th lines differ - expected: 'Alice', found: 'Bob'