QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#113867#6642. (1, 2) NimITMO_pengzoo#WA 7ms3780kbC++203.1kb2023-06-19 21:11:312023-06-19 21:11:33

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-19 21:11:33]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:3780kb
  • [2023-06-19 21:11:31]
  • 提交

answer

// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("unroll-loops")

#include <stdio.h>
#include <bits/stdc++.h>

#ifdef PERVEEVM_LOCAL
    #define debug(x) std::cerr << (#x) << ":\t" << (x) << std::endl
#else
    #define debug(x) 238
#endif

#define fastIO std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0)
#define NAME "File"

using ll = long long;
using ld = long double;

#ifdef PERVEEVM_LOCAL
    std::mt19937 rnd(238);
#else
    std::mt19937 rnd(std::chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

template<typename T1, typename T2>
std::ostream& operator<<(std::ostream& out, const std::pair<T1, T2>& p) {
    out << "(" << p.first << ", " << p.second << ")";
    return out;
}

template<size_t index, typename T>
std::ostream& print_tuple(std::ostream& out, const T& t) {
    if constexpr (index == std::tuple_size<T>::value) {
        out << ")";
        return out;
    } else {
        if (index > 0) {
            out << ", ";
        } else {
            out << "(";
        }
        out << std::get<index>(t);
        return print_tuple<index + 1, T>(out, t);
    }
}

template<typename ...T>
std::ostream& operator<<(std::ostream& out, const std::tuple<T...>& t) {
    return print_tuple<0, std::tuple<T...>>(out, t);
}

template<typename Container, typename = decltype(std::begin(std::declval<Container>()))>
typename std::enable_if<!std::is_same<Container, std::string>::value, std::ostream&>::type
operator<<(std::ostream& out, const Container& container) {
    out << "{";
    for (auto it = container.begin(); it != container.end(); ++it) {
        if (it != container.begin()) {
            out << ", ";
        }
        out << *it;
    }
    out << "}";
    return out;
}

template<typename T>
bool smin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool smax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

const double PI = atan2(0.0, -1.0);
const int INF = 0x3f3f3f3f;
const ll LINF = (ll)2e18;

void solve() {
	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; ++i) {
		int shit;
		scanf("%d", &shit);
	}

	if (n == 1) {
		printf("Sprague\n");
	} else {
		printf("Grundy\n");
	}
}

void run() {
	int t;
	scanf("%d", &t);

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

int main(void) {
    // freopen(NAME".in", "r", stdin);
    // freopen(NAME".out", "w", stdout);

    #ifdef PERVEEVM_LOCAL
        auto start = std::chrono::high_resolution_clock::now();
    #endif

    run();

    #ifdef PERVEEVM_LOCAL
        auto end = std::chrono::high_resolution_clock::now();
        std::cerr << "Execution time: "
                  << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count()
                  << " ms" << std::endl;
    #endif

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3780kb

input:

3
2
1 2
1
5
4
1 7 2 9

output:

Grundy
Sprague
Grundy

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 7ms
memory: 3724kb

input:

11337
9
4 1 2 3 2 4 3 2 3
10
1 7 1 5 1 2 2 2 1 3
9
1 3 7 3 3 1 1 3 2
12
1 1 2 4 1 2 2 4 2 2 1 4
15
1 3 4 3 1 2 1 4 1 1 1 1 1 1 1
8
3 3 2 2 3 9 1 2
10
2 2 2 2 1 5 1 2 7 2
10
2 2 2 3 2 2 3 5 2 2
7
2 2 6 2 2 3 5
10
1 1 1 3 1 1 1 5 1 1
8
2 2 2 2 5 2 10 1
5
3 10 1 3 1
8
3 4 2 2 1 1 11 1
6
6 4 8 2 4 2
10
...

output:

Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy
Grundy...

result:

wrong answer 22nd lines differ - expected: 'Sprague', found: 'Grundy'