QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#802231 | #9871. Just another Sorting Problem | ucup-team918# | WA | 1ms | 3628kb | C++14 | 1.8kb | 2024-12-07 13:07:30 | 2024-12-07 13:07:30 |
Judging History
answer
/* Code by pp_orange */
//#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define m_p(a,b) make_pair(a,b)
#define pb push_back
#define ll long long
#define ull unsigned long long
#define ld long double
#define inf 0x7FFFFFFF
#define inff 9223372036854775807
#define rep(i,l,r) for(int i=l;i<r;++i)
#define repp(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r-1;i>=l;--i)
#define pper(i,r,l) for(int i=r;i>=l;--i)
#define pii pair<int,int>
#define fi first
#define se second
#define p_q priority_queue
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ls(x) ((x)<<1)
#define rs(x) ((x)<<1|1)
#define lb(x) ((x)&-(x))
#define lg(x) (31^__builtin_clz(x))
#define vi vector<int>
#define vii vector<pii >
#define vT vector<T>
#define mm1 mint(1)
const int mod = 998244353;
//#define int ll
const int intsz = sizeof(int);
using namespace std;
inline int rd(){
int x(0),f(1);char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
while (isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
return x*f;
}
inline void out(int X){
if(X<0) {X=~(X-1); putchar('-');}
if(X>9) out(X/10);
putchar(X%10+'0');
}
ll pw(ll x,int d){
ll t = 1;
for(;d;d>>=1,x=x*x%mod)if(d&1)t = t*x%mod;
return t;
}
#define MAX 200005
int a[MAX];
signed main(){
//freopen("J.in","r",stdin);
//freopen("J.out","w",stdout);
int T = rd();
while(T--){
int n = rd();
repp(i,1,n)a[i] = rd();
string s;
cin >> s;
// cout<<s<<'\n';
int cnt = 0;
repp(i,1,n)cnt += (a[i]!=i);
if(s[0]=='A'&&cnt==2){
cout<<"Alice\n";
}else{
cout<<"Bob\n";
}
}
return 0;
}
/*
g++ J.cpp -o J -g -std=c++14 -Wall -Wshadow -fsanitize=undefined,address && ./J < in.in
ulimit -s unlimited
*/
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3628kb
input:
3 2 Alice 2 1 3 Bob 1 3 2 10 Bob 1 2 3 4 5 6 7 8 10 9
output:
Bob Bob Bob
result:
wrong answer 1st lines differ - expected: 'Alice', found: 'Bob'