QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#817864#9871. Just another Sorting Problemkenken714WA 0ms3788kbC++14906b2024-12-17 13:55:182024-12-17 13:55:18

Judging History

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

  • [2024-12-17 13:55:18]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3788kb
  • [2024-12-17 13:55:18]
  • 提交

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'