結果

問題 No.233 めぐるはめぐる (3)
ユーザー char134217728char134217728
提出日時 2017-09-12 21:28:23
言語 Ruby
(3.3.0)
結果
AC  
実行時間 444 ms / 1,000 ms
コード長 860 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 32,484 KB
最終ジャッジ日時 2024-04-25 07:10:53
合計ジャッジ時間 8,934 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 404 ms
32,320 KB
testcase_01 AC 386 ms
31,992 KB
testcase_02 AC 321 ms
32,260 KB
testcase_03 AC 370 ms
32,008 KB
testcase_04 AC 406 ms
32,184 KB
testcase_05 AC 415 ms
32,228 KB
testcase_06 AC 444 ms
32,320 KB
testcase_07 AC 439 ms
32,060 KB
testcase_08 AC 411 ms
32,484 KB
testcase_09 AC 275 ms
31,888 KB
testcase_10 AC 281 ms
32,288 KB
testcase_11 AC 280 ms
31,920 KB
testcase_12 AC 393 ms
31,984 KB
testcase_13 AC 412 ms
32,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'set'
_a = "aaeiuu".chars.permutation(6).to_a.uniq
_b = "bgmnr".chars.permutation(5).to_a.uniq
s = Set.new
_a.each do |a|
  _b.each do |b|
    s << ("" << a[0] << b[0] << a[1] << b[1] << a[2] << b[2] << a[3] << b[3] << a[4] << b[4] << a[5])
    s << ("" << b[0] << a[0] << a[1] << b[1] << a[2] << b[2] << a[3] << b[3] << a[4] << b[4] << a[5])
    s << ("" << b[0] << a[0] << b[1] << a[1] << a[2] << b[2] << a[3] << b[3] << a[4] << b[4] << a[5])
    s << ("" << b[0] << a[0] << b[1] << a[1] << b[2] << a[2] << a[3] << b[3] << a[4] << b[4] << a[5])
    s << ("" << b[0] << a[0] << b[1] << a[1] << b[2] << a[2] << b[3] << a[3] << a[4] << b[4] << a[5])
    s << ("" << b[0] << a[0] << b[1] << a[1] << b[2] << a[2] << b[3] << a[3] << b[4] << a[4] << a[5])
  end
end
gets.to_i.times do
  s.delete gets.chomp
end
if s.empty?
  puts :NO
else
  puts s.first
end
0