結果

問題 No.233 めぐるはめぐる (3)
ユーザー mazeppa1108mazeppa1108
提出日時 2015-06-28 17:27:44
言語 Haskell
(9.8.2)
結果
MLE  
実行時間 -
コード長 675 bytes
コンパイル時間 3,329 ms
コンパイル使用メモリ 160,144 KB
実行使用メモリ 147,520 KB
最終ジャッジ日時 2023-09-22 03:55:20
合計ジャッジ時間 11,268 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 AC 163 ms
56,184 KB
testcase_02 AC 73 ms
32,700 KB
testcase_03 AC 153 ms
56,336 KB
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 3 ms
7,004 KB
testcase_10 AC 3 ms
7,008 KB
testcase_11 AC 3 ms
6,988 KB
testcase_12 AC 173 ms
58,600 KB
testcase_13 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List
import Control.Applicative
import Control.Monad

main = do
  n <- readLn
  names <- replicateM n getLine
  let newNames = filter regal (permutations "inabameguru") \\ names
  case newNames of
    [] -> putStrLn "NO"
    _ -> putStrLn $ head newNames

regal [] = True
regal [charo] = if charo `elem` "iaeu"
                   then True
                   else False
regal (charo1 : charo2 : str) = if charo1 `elem` "iaeu"
                                   then regal (charo2 : str)
                                   else if charo2 `elem` "nbmgr"
                                           then False
                                           else regal str
0