結果
問題 |
No.4 おもりと天秤
|
ユーザー |
|
提出日時 | 2015-10-30 01:35:08 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 431 bytes |
コンパイル時間 | 1,757 ms |
コンパイル使用メモリ | 171,648 KB |
実行使用メモリ | 14,748 KB |
最終ジャッジ日時 | 2024-09-13 04:45:08 |
合計ジャッジ時間 | 8,510 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 2 TLE * 1 -- * 4 |
コンパイルメッセージ
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
ソースコード
-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU -- http://yukicoder.me/problems/19 main = do n <- getLine w <- getLine putStrLn $ main' n w main' n ws = let w = map read $ words ws s = foldl1 (+) w `div` 2 in if solve s 0 w then "possible" else "impossible" solve s p [] = s == p solve s p (x:xs) | s > p = solve s (p + x) xs || solve s p xs | otherwise = s == p