結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
情報学生
|
| 提出日時 | 2019-08-22 14:59:02 |
| 言語 | Haskell (9.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 377 bytes |
| 記録 | |
| コンパイル時間 | 3,092 ms |
| コンパイル使用メモリ | 195,456 KB |
| 実行使用メモリ | 6,656 KB |
| 最終ジャッジ日時 | 2026-04-28 23:42:41 |
| 合計ジャッジ時間 | 4,365 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 9 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/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
情報学生