結果

問題 No.239 にゃんぱすー
ユーザー momen999momen999
提出日時 2019-04-12 12:32:45
言語 Haskell
(9.8.2)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 559 bytes
コンパイル時間 2,300 ms
コンパイル使用メモリ 163,580 KB
実行使用メモリ 17,936 KB
最終ジャッジ日時 2023-10-11 23:38:09
合計ジャッジ時間 4,023 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,096 KB
testcase_01 AC 3 ms
7,116 KB
testcase_02 AC 2 ms
7,132 KB
testcase_03 AC 3 ms
7,012 KB
testcase_04 AC 2 ms
7,092 KB
testcase_05 AC 2 ms
7,052 KB
testcase_06 AC 3 ms
7,096 KB
testcase_07 AC 2 ms
7,056 KB
testcase_08 AC 3 ms
7,244 KB
testcase_09 AC 3 ms
7,340 KB
testcase_10 AC 3 ms
8,268 KB
testcase_11 AC 4 ms
8,720 KB
testcase_12 AC 5 ms
10,080 KB
testcase_13 AC 5 ms
9,504 KB
testcase_14 AC 5 ms
9,896 KB
testcase_15 AC 4 ms
9,192 KB
testcase_16 AC 5 ms
10,228 KB
testcase_17 AC 6 ms
11,012 KB
testcase_18 AC 12 ms
12,280 KB
testcase_19 AC 12 ms
12,608 KB
testcase_20 AC 23 ms
14,168 KB
testcase_21 AC 22 ms
15,044 KB
testcase_22 AC 23 ms
15,232 KB
testcase_23 AC 33 ms
15,260 KB
testcase_24 AC 42 ms
16,200 KB
testcase_25 AC 33 ms
16,216 KB
testcase_26 AC 43 ms
17,936 KB
testcase_27 AC 3 ms
7,156 KB
testcase_28 AC 3 ms
7,408 KB
testcase_29 AC 4 ms
8,928 KB
testcase_30 AC 4 ms
8,140 KB
testcase_31 AC 4 ms
8,752 KB
testcase_32 AC 12 ms
13,104 KB
testcase_33 AC 13 ms
13,060 KB
testcase_34 AC 13 ms
13,600 KB
testcase_35 AC 22 ms
16,216 KB
testcase_36 AC 13 ms
13,604 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.Monad (replicateM)
import Data.List (elemIndex)
import Data.Maybe (fromJust)

transpose :: [[a]] -> [[a]]
transpose ([]:_) = []
transpose xs = map head xs : transpose (map tail xs)

solve :: [[String]] -> Int
solve ns
    | isrentyon = succ $ fromJust $ elemIndex True r
    | otherwise = -1
    where
        r = map (all f) ys
        f s = s == "nyanpass" || s == "-"
        ys = transpose ns
        isrentyon = (length . filter (==True)) r == 1

main = do
    n <- readLn
    ns <- map words <$> replicateM n getLine
    print $ solve ns
0