結果

問題 No.1716 Bonus Nim
コンテスト
ユーザー square1001
提出日時 2021-10-22 23:26:32
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 467 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 651 ms
コンパイル使用メモリ 61,532 KB
最終ジャッジ日時 2026-04-11 12:44:01
合計ジャッジ時間 7,422 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp:3:1: error: 'uint64_t' does not name a type
    3 | uint64_t xorshift64(uint64_t seed) {
      | ^~~~~~~~
main.cpp:2:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    1 | #include <iostream>
  +++ |+#include <cstdint>
    2 | using namespace std;
main.cpp: In function 'int main()':
main.cpp:18:17: error: 'uint64_t' was not declared in this scope
   18 |                 uint64_t h = 0;
      |                 ^~~~~~~~
main.cpp:18:17: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
main.cpp:22:25: error: 'h' was not declared in this scope
   22 |                         h ^= xorshift64(a);
      |                         ^
main.cpp:22:30: error: 'xorshift64' was not declared in this scope
   22 |                         h ^= xorshift64(a);
      |                              ^~~~~~~~~~
main.cpp:24:26: error: 'h' was not declared in this scope
   24 |                 cout << (h != 0 ? "Alice" : "Bob") << '\n';
      |                          ^

ソースコード

diff #
raw source code

#include <iostream>
using namespace std;
uint64_t xorshift64(uint64_t seed) {
	seed *= 11111111111111111111ULL;
	seed ^= seed << 13;
	seed ^= seed >> 7;
	seed ^= seed << 17;
	return seed;
}
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int Q;
	cin >> Q;
	while (Q--) {
		int N;
		cin >> N;
		uint64_t h = 0;
		for (int i = 0; i < N; ++i) {
			int a;
			cin >> a;
			h ^= xorshift64(a);
		}
		cout << (h != 0 ? "Alice" : "Bob") << '\n';
	}
	return 0;
}
0