結果
| 問題 | No.1004 サイコロの実装 (2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-18 12:32:22 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 501 bytes |
| 記録 | |
| コンパイル時間 | 729 ms |
| コンパイル使用メモリ | 20,952 KB |
| 実行使用メモリ | 1,306,328 KB |
| 最終ジャッジ日時 | 2026-05-24 20:22:31 |
| 合計ジャッジ時間 | 6,415 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 MLE * 2 -- * 22 |
ソースコード
a, b, x0, N = map(int, input().split(' '))
MOD=2**32
x=[x0]
for n in range(N*2):
x.append(x[n]*a+b)
x=[(n%6)+1 for n in x]
x.pop(0)
if N==0:
print('0 0')
exit()
turn = 0
score=[[0,0],[0,0]]
position=[0,0]
for value in x:
position[turn]+=value
if position[turn]%2==1:
score[turn][0]+=1
else:
score[turn][1]+=1
turn = (turn+1) % 2
#print(score)
#print(position)
a_score = min(score[0])
b_score = min(score[1])
print(str(a_score)+' '+str(b_score))