結果

問題 No.58 イカサマなサイコロ
ユーザー tailstails
提出日時 2019-08-17 02:10:26
言語 Bash
(Bash 5.1.16)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 248 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 23:02:50
合計ジャッジ時間 917 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
4,348 KB
testcase_01 AC 40 ms
4,348 KB
testcase_02 AC 9 ms
4,348 KB
testcase_03 AC 6 ms
4,348 KB
testcase_04 AC 27 ms
4,348 KB
testcase_05 AC 31 ms
4,348 KB
testcase_06 AC 38 ms
4,348 KB
testcase_07 AC 9 ms
4,348 KB
testcase_08 AC 17 ms
4,348 KB
testcase_09 AC 36 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

read -dx n k
for((d=e=1;l<n;)){
	for((j=70;j--;)){
		for((i=6;--i;)){
			((d[j+i]+=d[j]))
			((e[j+i]+=e[j]*(i<3)))
		}
	}
	e=(0 0 0 ${e[@]})
	((l++<n-k))&&e=(${d[@]})
}
for((j=70;--j;)){
	((s+=(e[j]+=e[j+1])*d[j-1]))
}
echo $[1000*(s<<k)/36**n]e-3
0