結果
問題 | No.2103 ±1s Game |
ユーザー |
|
提出日時 | 2022-10-21 21:51:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 976 bytes |
コンパイル時間 | 1,578 ms |
コンパイル使用メモリ | 165,776 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 06:27:02 |
合計ジャッジ時間 | 3,310 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 WA * 2 |
ソースコード
#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'; } }