結果
| 問題 |
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
ソースコード
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
情報学生