結果

問題 No.2814 Block Game
ユーザー keisuke6
提出日時 2024-07-19 22:10:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 2,164 ms
コンパイル使用メモリ 195,176 KB
最終ジャッジ日時 2025-02-23 16:37:28
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
        }
    }
}
0