結果

問題 No.701 ひとりしりとり
ユーザー gemmarogemmaro
提出日時 2020-07-01 18:00:35
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 259 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 11,368 KB
実行使用メモリ 55,192 KB
最終ジャッジ日時 2023-10-12 02:39:49
合計ジャッジ時間 3,249 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 84 ms
15,248 KB
testcase_02 AC 83 ms
15,068 KB
testcase_03 AC 84 ms
15,112 KB
testcase_04 AC 85 ms
15,168 KB
testcase_05 AC 84 ms
15,076 KB
testcase_06 AC 84 ms
15,128 KB
testcase_07 AC 84 ms
15,132 KB
testcase_08 AC 84 ms
15,040 KB
testcase_09 AC 87 ms
15,376 KB
testcase_10 AC 107 ms
17,860 KB
testcase_11 AC 429 ms
55,192 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def solve
  return 'a' 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