結果

問題 No.216 FAC
ユーザー 情報学生情報学生
提出日時 2019-08-22 14:59:02
言語 Haskell
(9.10.1)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 9,438 ms
コンパイル使用メモリ 174,276 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-12 10:14:26
合計ジャッジ時間 7,952 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

main :: IO ()
main = interact $ solve . map read . words

f :: [(Int, Int)] -> (Int, Int)
f xs = foldr (\x acc -> if snd x == 0 then ((fst acc) + 1, snd acc) else (fst acc, (snd acc) + 1)) (0, 0) xs

solve :: [Int] -> String
solve (n:xs) = if (s - t) >= 0 then "YES" else "NO"
    where
        ys = take n xs
        zs = drop n xs
        ws = zip ys zs
        (s, t) = f ws
0