結果

問題 No.4 おもりと天秤
ユーザー HaarHaar
提出日時 2016-07-01 18:41:39
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 1,694 ms
コンパイル使用メモリ 172,160 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-04-20 05:04:18
合計ジャッジ時間 7,897 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,756 KB
testcase_01 WA -
testcase_02 AC 5 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 11 ms
6,940 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:7:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 13 further locations.
    Suggested fix: Please use spaces instead.
  |
7 |         where
  | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Applicative
import Data.List

func :: [Int] -> [Int]
func [] = [0]
func (x:xs) = nub (sort (map (+ x) t ++ t))
	where
		t = func xs

main = do
	getLine
	a <- map (read::String->Int) . words <$> getLine
	putStrLn $
		if elem ((sum a) `div` 2) (func a)
			then "possible"
			else "impossible"
0