結果
| 問題 |
No.2814 Block Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-18 00:43:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 469 ms / 2,000 ms |
| コード長 | 830 bytes |
| コンパイル時間 | 2,236 ms |
| コンパイル使用メモリ | 197,792 KB |
| 最終ジャッジ日時 | 2025-02-23 16:07:12 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)
int main() {
ll T;
cin >> T;
while(T--){
ll N;
cin >> N;
string s;
cin >> s;
ll X=N;
while(X%2==0) X/=2;
bool ok=true;
if(X==1){
if(s=="Odd"&&N>=4) ok=false;
if(s=="Even"&&N<4) ok=false;
}else{
if(N%2==0) ok=false;
}
if(ok){
cout << "Alice" << endl;
}else{
cout << "Bob" << endl;
}
}
return 0;
}