結果

問題 No.216 FAC
ユーザー Michae'GonMichae'Gon
提出日時 2015-07-17 15:56:32
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 3,457 ms
コンパイル使用メモリ 164,160 KB
実行使用メモリ 8,188 KB
最終ジャッジ日時 2023-09-22 16:58:35
合計ジャッジ時間 5,135 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,204 KB
testcase_01 AC 3 ms
7,200 KB
testcase_02 AC 2 ms
7,256 KB
testcase_03 AC 4 ms
7,860 KB
testcase_04 AC 3 ms
7,560 KB
testcase_05 AC 3 ms
7,516 KB
testcase_06 AC 2 ms
7,128 KB
testcase_07 AC 3 ms
7,112 KB
testcase_08 AC 3 ms
7,140 KB
testcase_09 AC 3 ms
7,148 KB
testcase_10 AC 3 ms
7,260 KB
testcase_11 AC 3 ms
7,092 KB
testcase_12 AC 3 ms
7,296 KB
testcase_13 AC 2 ms
7,280 KB
testcase_14 AC 3 ms
7,140 KB
testcase_15 AC 3 ms
7,244 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 3 ms
8,028 KB
testcase_19 AC 4 ms
8,068 KB
testcase_20 AC 4 ms
8,092 KB
testcase_21 AC 4 ms
8,088 KB
testcase_22 AC 3 ms
8,052 KB
testcase_23 AC 4 ms
8,136 KB
testcase_24 AC 4 ms
8,052 KB
testcase_25 AC 4 ms
8,188 KB
testcase_26 AC 3 ms
7,212 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
main = getLine >> getContents >>= putStrLn . solve . map (map read . words) . lines

solve :: [[Int]] -> String
solve [zs, ys]
    | acc' < mnum' = "NO"
    | otherwise = "YES"
    where
        (acc', mnum', _) = foldl ff (0, 0, zs) ys
        ff (acc, mnum, xs) y
            | y == 0 = (acc + head x', max mnum $ head x', xs')
            | otherwise = (acc, max mnum $ head x', xs')
            where
                (x', xs') = splitAt 1 xs
0