結果
問題 | No.254 文字列の構成 |
ユーザー |
👑 |
提出日時 | 2020-04-20 23:09:43 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 6,824 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-06 09:34:37 |
合計ジャッジ時間 | 1,392 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
local n = io.read("*n")local p = 1local s = {"ab", "cd", "ef"}local t = {"a", "c", "e"}while 0 < n dolocal a = 1for i = 1, n doif n < i * i then break enda = iendif 1 < a thenio.write(string.rep(s[p], a - 1))endio.write(t[p])n = n - a * ap = p + 1if p == 4 then p = 1 endendio.write("\n")