結果

問題 No.701 ひとりしりとり
ユーザー gemmarogemmaro
提出日時 2020-07-01 18:01:03
言語 Ruby
(3.3.0)
結果
AC  
実行時間 431 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 11,440 KB
実行使用メモリ 55,144 KB
最終ジャッジ日時 2023-10-12 02:39:52
合計ジャッジ時間 2,567 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,032 KB
testcase_01 AC 79 ms
15,032 KB
testcase_02 AC 83 ms
15,136 KB
testcase_03 AC 84 ms
15,252 KB
testcase_04 AC 85 ms
15,248 KB
testcase_05 AC 82 ms
15,348 KB
testcase_06 AC 83 ms
15,216 KB
testcase_07 AC 85 ms
15,212 KB
testcase_08 AC 84 ms
15,128 KB
testcase_09 AC 87 ms
15,376 KB
testcase_10 AC 105 ms
17,816 KB
testcase_11 AC 431 ms
55,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def solve
  return 'an' if N == 1

  centers_of_word = ('a'..'z').to_a.repeated_permutation(18).take(N).map(&:join)
  centers_of_word[0..(N - 2)].map { %(a#{_1}a) }.push(%(a#{centers_of_word[-1]}n))
end

N = gets.to_i

puts solve
0