結果
問題 | No.2103 ±1s Game |
ユーザー |
|
提出日時 | 2022-11-02 01:08:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 684 bytes |
コンパイル時間 | 1,646 ms |
コンパイル使用メモリ | 191,972 KB |
最終ジャッジ日時 | 2025-02-08 16:48:15 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 RE * 10 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);int X,Y,K,P;cin>>X>>Y>>K>>P;int beki[2]={1,-1};auto ans=[](int a){if(a==0)cout<<"Alice\n";else cout<<"Bob\n";};if((X+Y-K)%2){int T=(X+Y-K)/2;if(X<=T&&beki[K]!=P){ans(1);return 0;}if(Y<=T&&P!=1){ans(1);return 0;}if(X-1<=T&&beki[K]!=P&&Y-1<=T&&P!=1){ans(1);return 0;}ans(0);return 0;}else{int T=(X+Y-K)/2;if(X<=T&&beki[K]==P){ans(0);return 0;}if(Y<=T&&P==1){ans(0);return 0;}ans(1);return 0;}}