QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#135054#6642. (1, 2) NimVengeful_Spirit#WA 1ms3516kbC++20527b2023-08-05 10:56:202023-08-05 10:56:22

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-05 10:56:22]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3516kb
  • [2023-08-05 10:56:20]
  • 提交

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'