結果

問題 No.567 コンプリート
ユーザー 👑 obakyanobakyan
提出日時 2019-04-14 20:30:45
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 15:12:15
合計ジャッジ時間 860 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = io.read("*n")
if(n <= 5) then print(0) else
    t = {1, 0, 0, 0, 0, 0}
    for i = 2, n do
        t[1], t[2], t[3], t[4], t[5], t[6]
        =
        t[1] * 1 / 6,
        t[1] * 5 / 6 + t[2] * 2 / 6,
        t[2] * 4 / 6 + t[3] * 3 / 6,
        t[3] * 3 / 6 + t[4] * 4 / 6,
        t[4] * 2 / 6 + t[5] * 5 / 6,
        t[5] * 1 / 6 + t[6]
        if(0.99999999 < t[6]) then break end
    end
    print(t[6])
end
0