結果

問題 No.2666 Decreasing Modulo Nim
ユーザー Diana773Diana773
提出日時 2024-03-08 22:16:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 1,524 bytes
コンパイル時間 1,545 ms
コンパイル使用メモリ 166,372 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-08 22:16:07
合計ジャッジ時間 4,400 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 3 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 5 ms
6,676 KB
testcase_04 AC 24 ms
6,676 KB
testcase_05 AC 26 ms
6,676 KB
testcase_06 AC 4 ms
6,676 KB
testcase_07 AC 18 ms
6,676 KB
testcase_08 AC 9 ms
6,676 KB
testcase_09 AC 23 ms
6,676 KB
testcase_10 AC 18 ms
6,676 KB
testcase_11 AC 8 ms
6,676 KB
testcase_12 AC 6 ms
6,676 KB
testcase_13 AC 11 ms
6,676 KB
testcase_14 AC 7 ms
6,676 KB
testcase_15 AC 22 ms
6,676 KB
testcase_16 AC 6 ms
6,676 KB
testcase_17 AC 12 ms
6,676 KB
testcase_18 AC 17 ms
6,676 KB
testcase_19 AC 14 ms
6,676 KB
testcase_20 AC 12 ms
6,676 KB
testcase_21 AC 23 ms
6,676 KB
testcase_22 AC 6 ms
6,676 KB
testcase_23 AC 6 ms
6,676 KB
testcase_24 AC 7 ms
6,676 KB
testcase_25 AC 8 ms
6,676 KB
testcase_26 AC 19 ms
6,676 KB
testcase_27 AC 14 ms
6,676 KB
testcase_28 AC 24 ms
6,676 KB
testcase_29 AC 19 ms
6,676 KB
testcase_30 AC 25 ms
6,676 KB
testcase_31 AC 15 ms
6,676 KB
testcase_32 AC 31 ms
6,676 KB
testcase_33 AC 25 ms
6,676 KB
testcase_34 AC 5 ms
6,676 KB
testcase_35 AC 23 ms
6,676 KB
testcase_36 AC 17 ms
6,676 KB
testcase_37 AC 23 ms
6,676 KB
testcase_38 AC 25 ms
6,676 KB
testcase_39 AC 5 ms
6,676 KB
testcase_40 AC 19 ms
6,676 KB
testcase_41 AC 16 ms
6,676 KB
testcase_42 AC 16 ms
6,676 KB
testcase_43 AC 2 ms
6,676 KB
testcase_44 AC 2 ms
6,676 KB
testcase_45 AC 26 ms
6,676 KB
testcase_46 AC 27 ms
6,676 KB
testcase_47 AC 26 ms
6,676 KB
testcase_48 AC 26 ms
6,676 KB
testcase_49 AC 26 ms
6,676 KB
testcase_50 AC 26 ms
6,676 KB
testcase_51 AC 26 ms
6,676 KB
testcase_52 AC 26 ms
6,676 KB
testcase_53 AC 27 ms
6,676 KB
testcase_54 AC 27 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

template <typename Info>

struct SegmentTree
{
	int n;
	std::vector<Info> info;
	SegmentTree(int n): n(n-1),info(4<<std::__lg(n))
	{
	} 
	SegmentTree(std::vector<Info> init): SegmentTree(init.size())
	{
		std::function<void(int,int,int)> build= [&] (int pl,int l,int r)
		{
			if (l==r)
		    {
		    	info[pl]=init[l];
		    	return;
			}
			int mid=(l+r)>>1;
			build(pl*2,l,mid);
			build(pl*2+1,mid+1,r);
			pull(pl);
		};
		build (1,1,n);
	}
	void pull(int pl)
	{
		info[pl]=info[pl*2]+info[pl*2+1];
	} 
	void modify(int pl,int l,int r,int x,const Info &v)
	{
		if (l==r)
		{
			info[pl]=v;
			return;
		}
		int mid=(l+r)>>1;
		if (x<=mid) modify(pl*2,l,mid,x,v);
		if (x>mid)  modify(pl*2+1,mid+1,r,x,v);
		pull(pl);
	}
	void modify(int x,const Info &v)
	{
		modify(1,1,n,x,v);
	}
	Info rangeQuery(int pl,int l,int r,int x,int y)
	{
		if ((l>y)||(x>r)) 
		  return Info();
		if ((x<=l)&&(r<=y))
		  return info[pl];
		int mid=(l+r)>>1;
        return rangeQuery(pl*2,l,mid,x,y)+rangeQuery(pl*2+1,mid+1,r,x,y);
	}
	Info rangeQuery(int x,int y)
	{
		return rangeQuery(1,1,n,x,y);
	}
	 
}; 

using namespace std;

int _;
int n,l,r,m;
int a[200010];
int q[500010];
int uu[500010];

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	cin>>n>>m;
	int fl=0,fll=0,ai=1;
	for (int i=1; i<=n; i++)
	{
	  cin>>a[i];
	  fl=fl^(a[i]/m);
	  fll=fll^(a[i]%m);
	}
	if (fl!=0)
	  ai=1;
	else
	{
		if (fll!=0)
		  ai=1;
		else
		  ai=0;
	}
	
	if (ai)
	  cout<<"Alice";
	else
	  cout<<"Bob";

	
	return 0;
}
0