QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#817864 | #9871. Just another Sorting Problem | kenken714 | WA | 0ms | 3788kb | C++14 | 906b | 2024-12-17 13:55:18 | 2024-12-17 13:55:18 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1ll << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD (ll)1000000007
#define P pair<ll, ll>
string solve(ll n, string s){
ll te = 0;
REP(i, n){
ll x;
cin >> x;
if(i + 1 != x) te++;
}
if(n == 2)return "Alice";
if(te <= 2 and s == "Alice")return "Alice";
if(n == 3 and te == 2 and s == "Bob") return "Alice";
return "Bob";
}
int main() {
ll t;
cin >> t;
REP(i, t){
ll n;
string s;
cin >> n >> s;
cout << solve(n, s) << endl;
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3788kb
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 Alice Bob
result:
wrong answer 2nd lines differ - expected: 'Bob', found: 'Alice'