結果
| 問題 |
No.2813 Cookie
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-19 21:45:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 2,000 ms |
| コード長 | 785 bytes |
| コンパイル時間 | 568 ms |
| コンパイル使用メモリ | 71,936 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 21:45:53 |
| 合計ジャッジ時間 | 2,127 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 30 |
ソースコード
#include<iostream>
#include<set>
#include<cassert>
using namespace std;
set<int>S;
int G[100];
void dfs(int rest,int cur,int prv)
{
if(rest==0)
{
S.insert(cur);
return;
}
for(int t=prv;t>=1;t--)if(t<=rest)dfs(rest-t,cur^G[t],t);
}
long gru(long n)
{
if(n==0)return 0;
else if(n==1)return 1;
else if(n==2)return 1;
else if(n==3)return 2;
if(n%3==1)return (n+2)/3*4-6;
else return (n+2)/3*4-4;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
/*
G[0]=0;
for(int n=1;n<100;n++)
{
S.clear();
S.insert(G[0]);
dfs(n,0,n-1);
int v=0;
while(S.find(v)!=S.end())v++;
G[n]=v;
assert(v==gru(n));
}
*/
int T;cin>>T;
for(;T--;)
{
int N;cin>>N;
long g=0;
for(;N--;)
{
long a;cin>>a;
g^=gru(a);
}
cout<<(g?"Alice\n":"Bob\n");
}
}