QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#807453 | #9871. Just another Sorting Problem | WeiyeFeng | WA | 0ms | 3656kb | C++20 | 579b | 2024-12-09 23:55:41 | 2024-12-09 23:55:43 |
Judging History
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'