QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#325421 | #8224. Caught in the Middle | flying# | 0 | 0ms | 3784kb | C++14 | 653b | 2024-02-11 11:27:04 | 2024-07-04 03:23:28 |
answer
#include <bits/stdc++.h>
using namespace std;
const int N=1e6+5;
char s[N];
void work()
{
int n;
scanf("%d",&n);
scanf("%s",s+1);
int cnt=0;
for(int i=1;i<=n;i++)
if(s[i]=='R')
cnt++;
else
break;
bool Alice=false;
if(cnt==0)
Alice=true;
else if(n%(cnt*2)!=0)
Alice=true;
else
{
for(int i=1;i<=n;i++)
{
if(i%(cnt*2)<=cnt && i%(cnt*2)>=1 && s[i]=='L')
Alice=true;
if((i%(cnt*2)==0 || i%(cnt*2)>cnt) && s[i]=='R')
Alice=true;
}
}
if(Alice)
printf("Alice\n");
else
printf("Bob\n");
}
int main()
{
int T;
cin >> T;
while(T--)
work();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3784kb
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'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%