QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#802339 | #9871. Just another Sorting Problem | ucup-team1264# | WA | 0ms | 3816kb | C++20 | 766b | 2024-12-07 13:27:20 | 2024-12-07 13:27:23 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
void solve() {
int n; cin >> n;
string first; cin >> first;
vector<int> a(n);
int cnt = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
cnt += (a[i] != (i + 1));
}
if (n == 2) {
cout << "Alice\n";
return;
}
if (n == 3) {
if (first == "Alice" && cnt == 2) cout << "Alice\n";
else {
if (first == "Bob" && cnt == 3) cout << "Alice\n";
else cout << "Bob\n";
}
}
cout << ((first == "Alice" && cnt == 2) ? "Alice" : "Bob") << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t;
while (t--) solve();
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3816kb
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 Bob
result:
wrong output format Extra information in the output file