結果

問題 No.1004 サイコロの実装 (2)
ユーザー shamioshamio
提出日時 2020-06-27 09:24:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 298 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 34,056 KB
最終ジャッジ日時 2023-09-18 19:06:09
合計ジャッジ時間 11,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
29,544 KB
testcase_01 AC 131 ms
29,652 KB
testcase_02 AC 130 ms
29,648 KB
testcase_03 AC 130 ms
29,676 KB
testcase_04 AC 131 ms
29,716 KB
testcase_05 AC 131 ms
29,532 KB
testcase_06 AC 132 ms
29,584 KB
testcase_07 AC 132 ms
29,664 KB
testcase_08 AC 133 ms
29,584 KB
testcase_09 AC 133 ms
29,664 KB
testcase_10 AC 131 ms
29,748 KB
testcase_11 AC 132 ms
29,584 KB
testcase_12 AC 131 ms
29,664 KB
testcase_13 AC 132 ms
29,664 KB
testcase_14 AC 131 ms
29,588 KB
testcase_15 AC 133 ms
29,688 KB
testcase_16 AC 314 ms
29,584 KB
testcase_17 AC 786 ms
29,608 KB
testcase_18 AC 140 ms
29,760 KB
testcase_19 AC 184 ms
29,528 KB
testcase_20 AC 153 ms
29,692 KB
testcase_21 AC 607 ms
29,636 KB
testcase_22 AC 166 ms
29,648 KB
testcase_23 AC 198 ms
29,648 KB
testcase_24 AC 546 ms
29,612 KB
testcase_25 AC 462 ms
29,556 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

a, b, x0, n = map(np.uint32, input().split())

x = x0
stones = [[0, 0], [0, 0]]
now = [0, 0]
for i in range(2 * n):
    turn = i % 2
    x = a * x + b
    dice = x % 6 + 1
    now[turn] += dice
    now[turn] %= 2
    stones[turn][now[turn]] += 1

print(*list(map(min, stones)))
0