結果
問題 | No.1004 サイコロの実装 (2) |
ユーザー |
![]() |
提出日時 | 2025-03-20 21:21:48 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 729 bytes |
コンパイル時間 | 238 ms |
コンパイル使用メモリ | 82,460 KB |
実行使用メモリ | 82,944 KB |
最終ジャッジ日時 | 2025-03-20 21:22:42 |
合計ジャッジ時間 | 5,335 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 TLE * 1 -- * 13 |
ソースコード
a, b, x0, N = map(int, input().split())if N == 0:print(0, 0)else:x_prev = x0cur_t = 0cur_a = 0cnt_tb = 0cnt_tw = 0cnt_ab = 0cnt_aw = 0for i in range(1, 2 * N + 1):xi = (a * x_prev + b) % (1 << 32)di = (xi % 6) + 1if i % 2 == 1: # Takahashi's turncur_t += diif cur_t % 2 == 1:cnt_tb += 1else:cnt_tw += 1else: # Aoki's turncur_a += diif cur_a % 2 == 1:cnt_ab += 1else:cnt_aw += 1x_prev = xiscore_t = min(cnt_tb, cnt_tw)score_a = min(cnt_ab, cnt_aw)print(score_t, score_a)