QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#346985 | #8224. Caught in the Middle | crsfaa | 0 | 0ms | 3788kb | C++14 | 1.8kb | 2024-03-09 09:28:22 | 2024-03-09 09:28:22 |
answer
#include<bits/stdc++.h>
#define Yukinoshita namespace
#define Yukino std
using Yukinoshita Yukino;
int read()
{
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9') w=ch=='-'?-1:1,ch=getchar();
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
const int mod=998244353;
int qpow(int a,int p)
{
int mul=1;
for(;p;p>>=1)
{
if(p&1) mul=1ll*mul*a%mod;
a=1ll*a*a%mod;
}
return mul;
}
inline void getmod(int &x)
{
x-=(x>=mod)*mod;
}
const int mxn=1e6+5;
int fac[mxn],inv[mxn];
void init(int n)
{
fac[0]=1;
int i;
for(i=1;i<=n;i++)
fac[i]=1ll*fac[i-1]*i%mod;
inv[n]=qpow(fac[n],mod-2);
for(i=n;i;i--)
inv[i-1]=1ll*inv[i]*i%mod;
}
int C(int n,int m)
{
return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;
}
struct seg
{
int l,r,tag;
}t[mxn*4];
#define ls w<<1
#define rs ls|1
void build(int w,int l,int r)
{
t[w].l=l,t[w].r=r;
if(l<r)
{
int mid=l+r>>1;
build(ls,l,mid);
build(rs,mid+1,r);
}
}
void pushup(int w)
{
}
void ad(int w,int v)
{
}
void pushdown(int w)
{
if(t[w].tag)
ad(ls,t[w].tag),ad(rs,t[w].tag),t[w].tag=0;
}
int ask(int w,int l,int r)
{
if(t[w].l>=l&&t[w].r<=r) return 0;
pushdown(w);
int s=0;
if(t[ls].r>=l) s=ask(ls,l,r);
if(t[rs].l<=r) s+=ask(rs,l,r);
return s;
}
void add(int w,int l,int r,int v)
{
if(t[w].l>=l&&t[w].r<=r)
{
ad(w,v);
return;
}
pushdown(w);
if(t[ls].r>=l) add(ls,l,r,v);
if(t[rs].l<=r) add(rs,l,r,v);
pushup(w);
}
char s[mxn];
int main()
{
int T=read();
while(T--)
{
int n=read(),i;
scanf("%s",s+1);
if(n&1)
{
puts("Alice");
continue;
}
for(i=1;i<=n;i++)
if(i%2&&s[i]=='L'||i%2==0&&s[i]=='R')
{
puts("Alice");
goto bre;
}
puts("Bob");
bre:;
}
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3788kb
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%