結果
| 問題 |
No.2103 ±1s Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-21 22:20:35 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 798 bytes |
| コンパイル時間 | 1,682 ms |
| コンパイル使用メモリ | 192,152 KB |
| 最終ジャッジ日時 | 2025-02-08 10:13:31 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 WA * 4 |
ソースコード
#include <bits/stdc++.h>
#ifdef SHO_LOCAL
#include "debug.h"
#else
#define debug(...) \
{}
#endif
using namespace std;
void a() { cout << "Alice" << '\n'; }
void b() { cout << "Bob" << '\n'; }
int main() {
iostream::sync_with_stdio(0), cin.tie(0), cout.tie(0);
long long x, y, k, p;
cin >> x >> y >> k >> p;
long long t = x + y - k;
bool one_way = x <= t / 2 || y <= t / 2;
if (one_way) {
if (x < y) {
y -= t - x;
} else {
x -= t - y;
}
if (y == 0) {
if (p == 1)
a();
else
b();
} else {
if ((p == 1 && (y % 2 == 0)) || (p == -1 && (y & 1)))
a();
else
b();
}
} else if (t & 1) {
a();
} else {
b();
}
return 0;
}