結果
問題 |
No.1004 サイコロの実装 (2)
|
ユーザー |
![]() |
提出日時 | 2025-06-12 14:00:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 473 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 82,904 KB |
実行使用メモリ | 83,232 KB |
最終ジャッジ日時 | 2025-06-12 14:01:10 |
合計ジャッジ時間 | 5,443 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 WA * 17 TLE * 1 -- * 13 |
ソースコード
a, b, x0, N = map(int, input().split()) t_black = t_white = 0 a_black = a_white = 0 t_pos = a_pos = 0 x = x0 for i in range(N): x = (a * x + b) % (2**32) d = (x % 6) + 1 if i % 2 == 0: t_pos += d if t_pos % 2 == 1: t_black += 1 else: t_white += 1 else: a_pos += d if a_pos % 2 == 1: a_black += 1 else: a_white += 1 print(t_black * t_white, a_black * a_white)