QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#135054 | #6642. (1, 2) Nim | Vengeful_Spirit# | WA | 1ms | 3516kb | C++20 | 527b | 2023-08-05 10:56:20 | 2023-08-05 10:56:22 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
//Grundy
//Sprague
void solve() {
int n;
cin >> n;
vector<int> a(n);
for(auto &x : a) cin >> x;
sort(a.begin(), a.end());
if(n == 1) {
cout << "Sprague\n";
} else if(a[n-2] == 1 && a[n-1] > 1) {
cout << "Sprague\n";
} else {
cout << "Grundy\n";
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int T;
cin >> T;
while(T--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3516kb
input:
3 2 1 2 1 5 4 1 7 2 9
output:
Sprague Sprague Grundy
result:
wrong answer 1st lines differ - expected: 'Grundy', found: 'Sprague'