結果

問題 No.2666 Decreasing Modulo Nim
コンテスト
ユーザー ゆにぽけ
提出日時 2024-03-08 22:09:49
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 983 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 946 ms
コンパイル使用メモリ 149,268 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-07-04 00:45:17
合計ジャッジ時間 3,253 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 44 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <iterator>
#include <string>
#include <cctype>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cmath>
#include <ctime>
#include <iomanip>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <random>
#include <utility>
#include <functional>
using namespace std;
void Main()
{
	int N,M;
	cin >> N >> M;
	vector<int> A(N);
	for(int i = 0;i < N;i++)
	{
		cin >> A[i];
	}
	bool fn = false;
	int x = 0;
	for(int i = 0;i < N;i++)
	{
		int q = A[i] / M;
		if(q >= 1)
		{
			fn = true;
			x ^= q;
		}
	}
	if(fn)
	{
		cout << (x ? "Alice\n" : "Bob\n");
	}
	else
	{
		x = 0;
		for(int i = 0;i < N;i++)
		{
			x ^= A[i];
		}
		cout << (x ? "Alice\n" : "Bob\n");
	}
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int tt = 1;
	/* cin >> tt; */
	while(tt--) Main();
}
0