QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#497573#6642. (1, 2) NimrgnerdplayerWA 0ms3512kbC++20717b2024-07-29 14:17:352024-07-29 14:17:36

Judging History

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

  • [2024-07-29 14:17:36]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3512kb
  • [2024-07-29 14:17:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

using i64 = long long;

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);

    int t;
    cin >> t;

    auto solve = [&]() {
        int n;
        cin >> n;

        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        int c1 = count(a.begin(), a.end(), 1);

        if (c1 == n) {
            cout << (n % 3 == 1 ? "Sprague" : "Grundy") << '\n';
        } else if (c1 == n - 1) {
            cout << (n % 3 != 1 ? "Sprague" : "Grundy") << '\n';
        } else {
            cout << "Grundy\n";
        }
    };

    while (t--) {
        solve();
    }
    
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3512kb

input:

3
2
1 2
1
5
4
1 7 2 9

output:

Sprague
Grundy
Grundy

result:

wrong answer 1st lines differ - expected: 'Grundy', found: 'Sprague'