結果

問題 No.24 数当てゲーム
ユーザー gigurururugigurururu
提出日時 2015-04-09 00:05:39
言語 Haskell
(9.8.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 2,166 ms
コンパイル使用メモリ 165,964 KB
実行使用メモリ 7,500 KB
最終ジャッジ日時 2023-09-17 18:56:47
合計ジャッジ時間 3,133 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,360 KB
testcase_01 AC 2 ms
7,320 KB
testcase_02 AC 3 ms
7,364 KB
testcase_03 AC 3 ms
7,412 KB
testcase_04 AC 2 ms
7,424 KB
testcase_05 AC 3 ms
7,500 KB
testcase_06 AC 2 ms
7,432 KB
testcase_07 AC 3 ms
7,432 KB
testcase_08 AC 3 ms
7,400 KB
testcase_09 AC 3 ms
7,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 qualified Data.Set as S

main =
  putStrLn . head . S.elems . foldl f (S.fromList $ map show [0..9]) . map (splitAt 4 . words) . drop 1 . lines =<< getContents
  where
    f s (l,["YES"]) = S.intersection s $ S.fromList l
    f s (l,["NO"])  = S.difference   s $ S.fromList l
0