結果

問題 No.233 めぐるはめぐる (3)
ユーザー simansiman
提出日時 2023-01-03 11:53:27
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 11,184 KB
実行使用メモリ 37,580 KB
最終ジャッジ日時 2023-08-18 00:15:10
合計ジャッジ時間 8,778 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 280 ms
34,204 KB
testcase_01 AC 210 ms
28,664 KB
testcase_02 AC 156 ms
23,776 KB
testcase_03 AC 222 ms
29,536 KB
testcase_04 AC 380 ms
36,952 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 98 ms
19,068 KB
testcase_10 AC 100 ms
19,104 KB
testcase_11 AC 97 ms
19,040 KB
testcase_12 AC 211 ms
28,968 KB
testcase_13 AC 287 ms
34,208 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:25: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

A = %w(i a a e u u)
B = %w(n b m g r)

N = gets.to_i
memo = Hash.new
N.times do
  s = gets.chomp
  memo[s] = true
end

A.permutation(6).to_a.product(B.permutation(5).to_a).each do |a, b|
  s = ''

  6.times do |i|
    s << a[i]
    s << b[i] if i < 5
  end

  if memo[s].nil?
    puts s
    exit
  end
end

puts -1
0