結果

問題 No.1004 サイコロの実装 (2)
ユーザー lam6er
提出日時 2025-04-15 22:30:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 81,856 KB
実行使用メモリ 54,016 KB
最終ジャッジ日時 2025-04-15 22:32:13
合計ジャッジ時間 2,616 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, x0, N = map(int, input().split())

x0_mod2 = x0 % 2

d_takahashi = 1 - x0_mod2
d_aoki = x0_mod2

# Calculate Takahashi's stones
if d_takahashi == 1:
    t_black = (N + 1) // 2
    t_white = N // 2
else:
    t_black = 0
    t_white = N

# Calculate Aoki's stones
if d_aoki == 1:
    a_black = (N + 1) // 2
    a_white = N // 2
else:
    a_black = 0
    a_white = N

t_score = min(t_black, t_white)
a_score = min(a_black, a_white)

print(t_score, a_score)
0