結果

問題 No.1004 サイコロの実装 (2)
ユーザー gew1fw
提出日時 2025-06-12 14:07:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 53,888 KB
最終ジャッジ日時 2025-06-12 14:08:08
合計ジャッジ時間 2,735 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

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

c = x0 % 2

T = (N + 1) // 2
A = N // 2

# Takahashi's p is c
if c == 0:
    t_black = 0
    t_white = T
else:
    t_black = (T + 1) // 2
    t_white = T // 2

score_t = min(t_black, t_white)

# Aoki's p is 1 - c
p_a = 1 - c
if p_a == 0:
    a_black = 0
    a_white = A
else:
    a_black = (A + 1) // 2
    a_white = A // 2

score_a = min(a_black, a_white)

print(score_t, score_a)
0