結果

問題 No.239 にゃんぱすー
ユーザー okadukiokaduki
提出日時 2015-07-23 23:44:15
言語 Haskell
(9.8.2)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 9,936 ms
コンパイル使用メモリ 161,476 KB
実行使用メモリ 18,880 KB
最終ジャッジ日時 2023-09-22 21:54:06
合計ジャッジ時間 12,446 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,092 KB
testcase_01 AC 3 ms
7,056 KB
testcase_02 AC 3 ms
7,064 KB
testcase_03 AC 2 ms
7,080 KB
testcase_04 AC 3 ms
7,088 KB
testcase_05 AC 2 ms
7,092 KB
testcase_06 AC 3 ms
7,064 KB
testcase_07 AC 2 ms
7,164 KB
testcase_08 AC 3 ms
7,356 KB
testcase_09 AC 3 ms
7,348 KB
testcase_10 AC 4 ms
8,392 KB
testcase_11 AC 4 ms
8,748 KB
testcase_12 AC 5 ms
9,972 KB
testcase_13 AC 5 ms
9,564 KB
testcase_14 AC 5 ms
9,872 KB
testcase_15 AC 4 ms
9,324 KB
testcase_16 AC 5 ms
10,280 KB
testcase_17 AC 6 ms
11,116 KB
testcase_18 AC 12 ms
12,556 KB
testcase_19 AC 12 ms
12,880 KB
testcase_20 AC 22 ms
14,232 KB
testcase_21 AC 23 ms
15,236 KB
testcase_22 AC 33 ms
14,824 KB
testcase_23 AC 32 ms
16,340 KB
testcase_24 AC 32 ms
17,836 KB
testcase_25 AC 42 ms
18,620 KB
testcase_26 AC 42 ms
18,880 KB
testcase_27 AC 3 ms
7,324 KB
testcase_28 AC 3 ms
7,488 KB
testcase_29 AC 4 ms
9,000 KB
testcase_30 AC 3 ms
8,208 KB
testcase_31 AC 4 ms
8,880 KB
testcase_32 AC 22 ms
13,928 KB
testcase_33 AC 12 ms
13,196 KB
testcase_34 AC 12 ms
13,652 KB
testcase_35 AC 32 ms
16,828 KB
testcase_36 AC 12 ms
13,648 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 Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Text.Printf
import Debug.Trace

readInts :: B.ByteString -> [Int]
readInts = map (fst . fromJust . B.readInt) . B.words

getInts :: IO [Int]
getInts = liftM readInts B.getLine

f xss n = filter ok [0..(n-1)]
  where
    ok i = and $ map (\j -> xss!!j!!i == "nyanpass"
                              || xss!!j!!i == "-") [0..(n-1)]

printAns xs = if length xs == 1 
              then print $ 1 + head xs
              else print (-1)

main = do
  [n] <- getInts
  xss <- fmap words <$> replicateM n getLine
  printAns $ f xss n
0