結果

問題 No.432 占い(Easy)
ユーザー 👑 obakyanobakyan
提出日時 2019-03-29 20:57:25
言語 Lua
(LuaJit 2.1.1696795921)
結果
RE  
実行時間 -
コード長 386 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-24 16:44:22
合計ジャッジ時間 4,020 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,624 KB
testcase_01 RE -
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 RE -
testcase_07 WA -
testcase_08 AC 2 ms
5,376 KB
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = io.read("*n")
for i = 1, n do
    a = io.read("*n")
    t = {}
    len = 0
    while(a ~= 0) do
        table.insert(t, 1, a % 10)
        len = len + 1
        a = math.floor(a / 10)
    end
    for j = len, 2, -1 do
        for k = 1, j - 1 do
            b = t[k] + t[k + 1]
            t[k] = math.floor(b / 10) + b % 10
        end
    end
    io.write(t[1]) io.write("\n")
end
0