結果
問題 | No.2103 ±1s Game |
ユーザー |
|
提出日時 | 2022-10-22 00:02:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 1,000 ms |
コード長 | 1,270 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 82,216 KB |
実行使用メモリ | 56,288 KB |
最終ジャッジ日時 | 2024-07-01 08:03:55 |
合計ジャッジ時間 | 2,825 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
import sys, random input = lambda : sys.stdin.readline().rstrip() write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x)) debug = lambda x: sys.stderr.write(x+"\n") YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); INF=10**18 LI = lambda : list(map(int, input().split())); II=lambda : int(input()); SI=lambda : [ord(c)-ord("a") for c in input()] def debug(_l_): for s in _l_.split(): print(f"{s}={eval(s)}", end=" ") print() def dlist(*l, fill=0): if len(l)==1: return [fill]*l[0] ll = l[1:] return [dlist(*ll, fill=fill) for _ in range(l[0])] x,y,k,p = list(map(int, input().split())) num = x+y-k p = pow(-1,y)*p if p==1: if num%2==0: m = min(x,y) if m>=num//2+1: v = 0 else: v = (m+1)%2 else: if min(x,y)>=(num+1)//2: v = 1 elif x>y: v = (y+1)%2 else: v = (x)%2 else: if num%2==0: m = min(x,y) if m>=num//2+1: v = 0 else: v = m%2 else: m = min(x,y) if m>=(num+1)//2: v = 1 elif x>y: v = (y)%2 else: v = (x+1)%2 YES = "Alice" NO = "Bob" pans(v)