結果

問題 No.1004 サイコロの実装 (2)
ユーザー Rute
提出日時 2020-03-06 21:58:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,700 KB
最終ジャッジ日時 2024-10-14 06:47:19
合計ジャッジ時間 5,409 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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
        t_s[t%2] += 1
    else:
        a += deme
        a_s[t%2] += 1
print(min(t_s),min(a_s))
0