結果
| 問題 |
No.2103 ±1s Game
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2022-10-21 22:35:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 745 bytes |
| コンパイル時間 | 1,866 ms |
| コンパイル使用メモリ | 193,084 KB |
| 最終ジャッジ日時 | 2025-02-08 10:16:23 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll x,y,k,p;
cin>>x>>y>>k>>p;
ll z=x+y-k;
if(p==1){
if((z+1)/2>=y) cout<<"Alice"<<endl;
else if((z+1)/2>=x && k%2==0) cout<<"Alice"<<endl;
else if(z/2>=x && k%2==1) cout<<"Bob"<<endl;
else if(z%2==0) cout<<"Bob"<<endl;
else cout<<"Alice"<<endl;
}
else if(p==-1){
if(z/2>=y) cout<<"Bob"<<endl;
else if(z/2>=x && k%2==0) cout<<"Bob"<<endl;
else if((z+1)/2>=x && k%2==1) cout<<"Alice"<<endl;
else if(z%2==0) cout<<"Bob"<<endl;
else cout<<"Alice"<<endl;
}
return 0;
}
umezo