結果
| 問題 | No.3460 Chocolate Divide Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-28 14:24:31 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 589 bytes |
| 記録 | |
| コンパイル時間 | 4,086 ms |
| コンパイル使用メモリ | 342,492 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-02-28 14:24:37 |
| 合計ジャッジ時間 | 4,515 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 7 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#include<atcoder/modint>
using namespace atcoder;
using mint=modint998244353;
map<ll,ll> ISW;
bool W(ll N){
if(N==1)return 0;
if(ISW.count(N))return ISW[N];
for(int i=1;i<=N/2;i++){
if(!W(N-i)){
ISW[N]=1;
return 1;
}
}
ISW[N]=0;
return 0;
}
void solve(){
ll N;
cin>>N;
cout<<(__builtin_popcountll(N+1)==1?"Bob\n":"Alice\n");
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin>>T;
while(T--)solve();
}