結果
| 問題 |
No.2103 ±1s Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-21 21:51:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 975 bytes |
| コンパイル時間 | 1,577 ms |
| コンパイル使用メモリ | 167,356 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 06:28:14 |
| 合計ジャッジ時間 | 2,566 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
long long x, y, k, p, t;
cin >> x >> y >> k >> p;
t = x + y - k;
long long at = (t + 1) / 2, bt = t / 2;
if(t & 1){
if(min(x, y) > max(at, bt)){
cout << "Alice" << '\n';
return 0;
}
if(y <= bt && p == -1){
cout << "Bob" << '\n';
return 0;
}
if(x <= bt && ((k % 2 == 1) != (p == -1))){
cout << "Bob" << '\n';
return 0;
}
cout << "Alice" << '\n';
}else{
if(min(x, y) > max(at, bt)){
cout << "Bob" << '\n';
return 0;
}
if(y <= at && p == 1){
cout << "Alice" << '\n';
return 0;
}
if(x <= at && ((k % 2 == 1) == (p == -1))){
cout << "Alice" << '\n';
return 0;
}
cout << "Bob" << '\n';
}
}