QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#188352 | #6642. (1, 2) Nim | rsj | WA | 0ms | 3628kb | C++14 | 316b | 2023-09-25 19:19:06 | 2023-09-25 19:19:07 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int a[100010];
void get() {
int n,i,x=0;
cin>>n; for(i=1;i<=n;i++) {
cin>>a[i];
if(a[i]==1) x++;
}
if(n==1||(x%3==1&&n==x)||(x%3!=2&&n==x+1)) cout<<"Sprague\n";
else cout<<"Grundy\n";
}
int main() {
int T; cin>>T; while(T--) get();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3628kb
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'