結果

問題 No.701 ひとりしりとり
ユーザー simansiman
提出日時 2020-10-18 20:32:53
言語 Ruby
(3.3.0)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,464 KB
実行使用メモリ 30,352 KB
最終ジャッジ日時 2023-09-28 12:04:05
合計ジャッジ時間 2,934 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,192 KB
testcase_01 AC 86 ms
15,140 KB
testcase_02 AC 84 ms
15,244 KB
testcase_03 AC 83 ms
15,172 KB
testcase_04 AC 84 ms
15,260 KB
testcase_05 AC 86 ms
15,280 KB
testcase_06 AC 86 ms
15,092 KB
testcase_07 AC 88 ms
15,256 KB
testcase_08 AC 86 ms
15,048 KB
testcase_09 AC 87 ms
15,272 KB
testcase_10 AC 106 ms
16,420 KB
testcase_11 AC 311 ms
30,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - cur
Syntax OK

ソースコード

diff #

N = gets.to_i

cur = 'a'
ans = []
chars = [*?a..?z] - ['n']

chars.permutation(5).take(N - 1).each do |list|
  str = 'a' + list.join + 'a'
  ans << str
end

ans << 'an'
puts ans
0