結果
問題 | No.254 文字列の構成 |
ユーザー |
![]() |
提出日時 | 2021-07-29 14:43:55 |
言語 | Crystal (1.14.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 12,751 ms |
コンパイル使用メモリ | 294,492 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 12:01:07 |
合計ジャッジ時間 | 14,591 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
def square(n : Int32)sqrt = Math.sqrt(n).to_i + 1while sqrt * sqrt > nsqrt -= 1endsqrtendn = read_line.to_ia = [] of Int32while n > 0s = square(n)a << s - 1n -= s * sendnow = 'a'puts a.map_with_index { |x, i|if x == 0now.tap { now += 1 }elsec1, c2 = now, now + 1now += 2"#{c1}#{c2}" * x + c1end}.join