結果

問題 No.2059 Odd Move Nim
ユーザー square1001square1001
提出日時 2022-08-26 21:49:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 445 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 69,336 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-21 23:53:03
合計ジャッジ時間 2,703 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 2 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 85 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 87 ms
5,376 KB
testcase_16 AC 88 ms
5,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 86 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <iostream>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> A(N + 1);
	for (int i = 1; i <= N; i++) {
		cin >> A[i];
	}
	int parity = 0;
	for (int i = 1; i <= N; i++) {
		if (i % 2 == 0 && A[i] % 2 == 1) {
			parity ^= 1;
		}
	}
	bool cond = true;
	for (int i = 2; i <= N; i += 2) {
		if (A[i] % 2 == 0) {
			cond = false;
		}
	}
	cout << (parity == 0 && cond ? "Bob" : "Alice") << endl;
	return 0;
}
0