結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
yuruhiya
|
| 提出日時 | 2020-10-21 18:39:57 |
| 言語 | Crystal (1.14.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 752 bytes |
| コンパイル時間 | 13,052 ms |
| コンパイル使用メモリ | 301,712 KB |
| 実行使用メモリ | 57,264 KB |
| 最終ジャッジ日時 | 2024-06-30 21:26:18 |
| 合計ジャッジ時間 | 20,400 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 6 |
ソースコード
lib C
fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64
end
class String
def to_i64
C.strtoll(self, nil, 10)
end
end
vowel, cons = "iaaeuu", "nbmgr"
size = vowel.size + cons.size
strings = [] of String
(0...6).each { |vowel_pos|
f = [0, 1] * 5
f.insert({0, vowel_pos * 2 - 1}.max, 1)
vowel.chars.each_permutation { |v|
cons.chars.each_permutation { |c|
v_i, c_i = -1, -1
strings << (0...size).map { |i|
if f[i] == 0
c_i += 1
cons[c_i]
else
v_i += 1
vowel[v_i]
end
}.join
}
}
}
strings.uniq!
n = read_line.to_i
s = (1..n).map { read_line }.sort
ans = strings.find { |str|
s.bsearch { |i| i >= str } != str
}
puts ans ? ans : "NO"
yuruhiya