結果

問題 No.1004 サイコロの実装 (2)
ユーザー mnrmnr
提出日時 2020-03-06 23:19:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 477 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 59,476 KB
最終ジャッジ日時 2024-04-22 10:35:03
合計ジャッジ時間 5,409 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
17,692 KB
testcase_01 AC 33 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 33 ms
10,752 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 33 ms
10,752 KB
testcase_06 RE -
testcase_07 AC 34 ms
10,880 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 31 ms
10,880 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 WA -
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 #

a,b,x,N = map(int,input().split())
m = 2**32
X = [x]
for i in range(N):
    X.append(((a*X[i-1]+b)%m)%6+1)
La = [0]
Lt = [0]
for i in range(1,N+1,2):
    La.append(La[-1] + X[i])
for i in range(2,N+1,2):
    Lt.append(Lt[-1] + X[i])
ab = 0
aw = -1
tb = 0
tw = -1
for i in La:
    if La[i] % 2 == 1:
        ab += 1
    elif La[i] % 2 == 0:
        aw += 1
for i in Lt:
    if Lt[i] % 2 == 1:
        tb += 1
    elif Lt[i] % 2 == 0:
        tw += 1
print(min(ab,aw),min(tb,tw))
0