QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#127531 | #6642. (1, 2) Nim | xjsc01 | WA | 1ms | 3584kb | C++23 | 438b | 2023-07-19 19:23:53 | 2023-07-19 19:23:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
while(T--){
int n;
scanf("%d", &n);
int k = 0;
for(int i = 1; i <= n; i++){
int t;
scanf("%d", &t);
if(t >= 2) k++;
}
bool xian;
if(k == 0) {
xian = n % 3 == 1;
}
else if(k == 1){
xian = !(n%3 == 2);
}
else{
xian = 0;
}
if(xian) puts("Grundy");
else puts("Sprague");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3584kb
input:
3 2 1 2 1 5 4 1 7 2 9
output:
Sprague Grundy Sprague
result:
wrong answer 1st lines differ - expected: 'Grundy', found: 'Sprague'