結果
| 問題 |
No.2814 Block Game
|
| コンテスト | |
| ユーザー |
keisuke6
|
| 提出日時 | 2024-07-19 22:09:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 661 bytes |
| コンパイル時間 | 2,011 ms |
| コンパイル使用メモリ | 194,316 KB |
| 最終ジャッジ日時 | 2025-02-23 16:36:55 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
int f(int a, int x){
int ans = 1;
for(int i=0;i<x;i++) ans *= a;
return ans;
}
signed main(){
int T;
cin>>T;
while(T--){
int n;
string s;
cin>>n>>s;
int c = 0;
for(int i=0;i<60;i++)if((n-1)&(1ll<<i)) c++;
int a = f(2,c);
int b = n-a;
int k = (n+1)/2;
if(b == 0){
if(s == "Even") cout<<(k%2 ? "Alice" : "Bob")<<endl;
else cout<<(k%2 ? "Bob" : "Alice")<<endl;
continue;
}
else{
cout<<(a == b ? "Bob" : "Alice")<<endl;
}
}
}
keisuke6