QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#188352#6642. (1, 2) NimrsjWA 0ms3628kbC++14316b2023-09-25 19:19:062023-09-25 19:19:07

Judging History

你现在查看的是最新测评结果

  • [2023-09-25 19:19:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2023-09-25 19:19:06]
  • 提交

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'