結果
| 問題 |
No.1004 サイコロの実装 (2)
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 19:01:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 606 bytes |
| コンパイル時間 | 306 ms |
| コンパイル使用メモリ | 82,328 KB |
| 実行使用メモリ | 66,604 KB |
| 最終ジャッジ日時 | 2025-06-12 19:01:38 |
| 合計ジャッジ時間 | 5,667 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 18 TLE * 1 -- * 13 |
ソースコード
a, b, x0, N = map(int, input().split())
t_black = 0
t_white = 0
a_black = 0
a_white = 0
t_pos = 0
a_pos = 0
x_current = x0
for i in range(N):
x_current = (a * x_current + b) % (2 ** 32)
d = (x_current % 6) + 1
if (i + 1) % 2 == 1: # Takahashi's turn
t_pos += d
if t_pos % 2 == 1:
t_black += 1
else:
t_white += 1
else: # Aoki's turn
a_pos += d
if a_pos % 2 == 1:
a_black += 1
else:
a_white += 1
t_score = min(t_black, t_white)
a_score = min(a_black, a_white)
print(t_score, a_score)
gew1fw