QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#343291 | #8287. Caught in the Middle | mendicillin2# | WA | 0ms | 3908kb | C++17 | 656b | 2024-03-02 13:28:33 | 2024-03-02 13:28:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
inline int read()
{
int x=0,f=1;
char c=getchar();
while(c<'0' || c>'9')
{
if(c=='-') f=-1;
c=getchar();
}
while(c>='0' && c<='9')
{
x=x*10+c-'0';
c=getchar();
}
return x*f;
}
int n;
const int N=1e6+5;
char c[N];
int main()
{
int T=read();
while(T--)
{
n=read();
scanf("%s",c+1);
if(n%2==1) printf("Alice\n");
else
{
bool flag=true;
for(int i=1;i<=n;i++)
{
if(i%2==1 && c[i]!='R') flag=false;
else if(i%2==0 && c[i]!='L') flag=false;
}
if(flag) printf("Bob\n");
else printf("Alice\n");
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3908kb
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 Alice Alice Alice Alice Alice Alice Bob Alice Alice Alice
result:
wrong answer 11th lines differ - expected: 'Bob', found: 'Alice'