QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#497573 | #6642. (1, 2) Nim | rgnerdplayer | WA | 0ms | 3512kb | C++20 | 717b | 2024-07-29 14:17:35 | 2024-07-29 14:17:36 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t;
cin >> t;
auto solve = [&]() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int c1 = count(a.begin(), a.end(), 1);
if (c1 == n) {
cout << (n % 3 == 1 ? "Sprague" : "Grundy") << '\n';
} else if (c1 == n - 1) {
cout << (n % 3 != 1 ? "Sprague" : "Grundy") << '\n';
} else {
cout << "Grundy\n";
}
};
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3512kb
input:
3 2 1 2 1 5 4 1 7 2 9
output:
Sprague Grundy Grundy
result:
wrong answer 1st lines differ - expected: 'Grundy', found: 'Sprague'