QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#325421#8224. Caught in the Middleflying#0 0ms3784kbC++14653b2024-02-11 11:27:042024-07-04 03:23:28

Judging History

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

  • [2024-07-04 03:23:28]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3784kb
  • [2024-02-11 11:27:04]
  • 提交

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%