結果
| 問題 |
No.2814 Block Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-19 22:05:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 458 bytes |
| コンパイル時間 | 619 ms |
| コンパイル使用メモリ | 64,384 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 22:05:40 |
| 合計ジャッジ時間 | 4,019 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 20 |
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
bool f(long N,string S)
{
int pc=__builtin_popcountll(N);
if((1LL<<pc)-1==N)
{
if(N%4*((N+1)%4)/2%2==0)
{
return S=="Even";
}
else
{
return S=="Odd";
}
}
if(N%2==1&&S=="Odd")return false;
else return true;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;cin>>T;
for(;T--;)
{
long N;
string S;
cin>>N>>S;
cout<<(f(N,S)?"Alice\n":"Bob\n");
}
}