結果
| 問題 |
No.2103 ±1s Game
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2022-10-21 21:44:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 731 bytes |
| コンパイル時間 | 4,165 ms |
| コンパイル使用メモリ | 250,064 KB |
| 最終ジャッジ日時 | 2025-02-08 09:57:36 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 13 RE * 21 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 3000000000000000
int get(long long y){
if(y%2==0)return 1;
else return -1;
}
int main(){
long long X,Y,K,P;
cin>>X>>Y>>K>>P;
long long turns = X+Y-K;
long long need = 0;
if(Y%2==1)need = 1;
if(P==-1)need ^= 1;
long long x = (turns+1)/2;
long long y = turns-x;
if(turns%2==0){
y--;
if(X<=x&&get(Y-(turns-X))==P){
cout<<"Alice"<<endl;
return 0;
}
if(Y<=x&&get(0)==P){
cout<<"Alice"<<endl;
return 0;
}
cout<<"Bob"<<endl;
}
else{
assert(0);
}
return 0;
}
沙耶花