QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#807453#9871. Just another Sorting ProblemWeiyeFengWA 0ms3656kbC++20579b2024-12-09 23:55:412024-12-09 23:55:43

Judging History

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

  • [2024-12-09 23:55:43]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3656kb
  • [2024-12-09 23:55:41]
  • 提交

answer

#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

int t, n;
string name;
signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    cin >> t;
    while(t--) {
        cin >> n >> name;

        int pre = 0, cnt = 0;
        while(n--) {
            int e; cin >> e;
            if (e < pre) cnt++;

            pre = e;
        }

        if (cnt == 1) cout << name << endl;
        else {
            if (name == "Alice") cout << "Bob" << endl;
            else cout << "Alice" << endl;
        }
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3604kb

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: 3656kb

input:

2
2 Alice
2 1
2 Bob
2 1

output:

Alice
Bob

result:

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