結果

問題 No.1004 サイコロの実装 (2)
ユーザー Rute
提出日時 2020-03-06 21:57:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,824 KB
最終ジャッジ日時 2024-10-14 06:43:12
合計ジャッジ時間 5,280 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 18 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def mod(n,m):
    return int(math.fmod(n,m))
import math
t = 0
t_s = [0,0]
a = 0
a_s = [0,0]
a,b,x,N = map(int,input().split())
for i in range(N*2):
    x = mod(3*x+b,2**32)
    deme = x%6+1
    if i%2 == 0:
        t += deme
        if t%2 == 0:
            t_s[0] += 1
        else:
            t_s[1] += 1
    else:
        a += deme
        if t%2 == 0:
            a_s[0] += 1
        else:
            a_s[1] += 1
print(min(t_s),min(a_s))
0