提出 #70101140


ソースコード 拡げる

//# pragma GCC target("avx2")
# pragma GCC optimize("O3")
# pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#include"atcoder/all"
using namespace atcoder;
typedef modint998244353 mi;
using namespace std;
#define all(a) a.begin(),a.end()
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
#define compress(a) sort(all(a));a.erase(unique(all(a)),a.end())
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
constexpr ll mod=998244353;
constexpr ll inf=3e18;

void solve(){
	int n;
	cin>>n;
	vector<ll>a(n);
	rep(i,n)cin>>a[i];
	vector<int>cnt(31);
	rep(i,n){
		rep(j,31){
			if(a[i]&(1<<j))cnt[j]++;
		}
	}
	int res=0,e=0;
	rep(j,30){
		if(cnt[j]>=2&&cnt[j]%2==1){
			res++;
		}
		else if(cnt[j]>=2&&cnt[j]%2==0){
			e++;
		}
	}

	if(e==0){
		cout<<"Bob"<<endl;
	}
	else{
		cout<<"Alice"<<endl;
	}

}

int main(){
	int t;
	cin>>t;
	while(t--)solve();
}

提出情報

提出日時
問題 A - Bitwise OR Game
ユーザ Rho17
言語 C++ 20 (gcc 12.2)
得点 500
コード長 1099 Byte
結果 AC
実行時間 167 ms
メモリ 4896 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 500 / 500
結果
AC × 1
AC × 23
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 02_Bob_00.txt, 02_Bob_01.txt, 02_Bob_02.txt, 02_Bob_03.txt, 02_Bob_04.txt, 02_Bob_05.txt, 02_Bob_06.txt, 02_Bob_07.txt, 02_Bob_08.txt, 03_Alice_00.txt, 03_Alice_01.txt, 03_Alice_02.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3508 KiB
01_handmade_00.txt AC 140 ms 3572 KiB
01_handmade_01.txt AC 165 ms 3536 KiB
01_handmade_02.txt AC 95 ms 3644 KiB
01_handmade_03.txt AC 123 ms 3724 KiB
01_handmade_04.txt AC 167 ms 3564 KiB
01_handmade_05.txt AC 129 ms 3548 KiB
01_handmade_06.txt AC 99 ms 3540 KiB
01_handmade_07.txt AC 54 ms 3560 KiB
01_handmade_08.txt AC 56 ms 4692 KiB
01_handmade_09.txt AC 55 ms 4800 KiB
02_Bob_00.txt AC 56 ms 3528 KiB
02_Bob_01.txt AC 56 ms 3760 KiB
02_Bob_02.txt AC 53 ms 3564 KiB
02_Bob_03.txt AC 54 ms 3676 KiB
02_Bob_04.txt AC 52 ms 4760 KiB
02_Bob_05.txt AC 52 ms 4776 KiB
02_Bob_06.txt AC 52 ms 4740 KiB
02_Bob_07.txt AC 47 ms 4896 KiB
02_Bob_08.txt AC 127 ms 3552 KiB
03_Alice_00.txt AC 58 ms 3572 KiB
03_Alice_01.txt AC 56 ms 3752 KiB
03_Alice_02.txt AC 56 ms 3600 KiB