結果
問題 | No.1004 サイコロの実装 (2) |
ユーザー |
|
提出日時 | 2020-03-29 12:08:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 402 bytes |
コンパイル時間 | 407 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 20,608 KB |
最終ジャッジ日時 | 2025-01-02 13:18:40 |
合計ジャッジ時間 | 45,131 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 TLE * 14 |
ソースコード
a, b, x, n = [int(w) for w in input().split()] m = 2 ** 32 p1 = [[0, 0], 0] p2 = [[0, 0], 0] is_turn_1 = True def turn(player, dice): player[1] += dice % 6 + 1 player[0][player[1] % 2] += 1 for i in range(n*2): x = (a * x + b) % m # print(x, x % 6+1) if is_turn_1: turn(p1, x) else: turn(p2, x) is_turn_1 = not is_turn_1 print(min(p1[0]), min(p2[0]))