QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#802236#9871. Just another Sorting Problemucup-team918#WA 0ms3840kbC++141.8kb2024-12-07 13:08:292024-12-07 13:08:30

Judging History

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

  • [2024-12-07 13:08:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3840kb
  • [2024-12-07 13:08:29]
  • 提交

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();
		string s;
		cin >> s;
		repp(i,1,n)a[i] = rd();
		
		// 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: 100
Accepted
time: 0ms
memory: 3840kb

input:

3
2 Alice
2 1
3 Bob
1 3 2
10 Bob
1 2 3 4 5 6 7 8 10 9

output:

Alice
Bob
Bob

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3608kb

input:

2
2 Alice
2 1
2 Bob
2 1

output:

Alice
Bob

result:

wrong answer 2nd lines differ - expected: 'Alice', found: 'Bob'