結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー 👑 obakyanobakyan
提出日時 2019-05-02 10:21:38
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 911 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-30 04:42:19
合計ジャッジ時間 6,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
4,376 KB
testcase_01 AC 29 ms
4,376 KB
testcase_02 AC 21 ms
4,376 KB
testcase_03 AC 54 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 3 ms
4,376 KB
testcase_09 AC 37 ms
4,376 KB
testcase_10 AC 911 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n = io.read("*n")
local iow = io.output()
local amax = math.floor(n / 3)
local str = ""
for a = 1, amax do
  str = a .. " "
  local bmax = math.floor((n - a) / 2)
  for b = a, bmax do
    iow:write(str .. b .. " " .. n - a - b .. "\n")
  end
end
0