Submission #97309
Source Code Expand
{-# OPTIONS_GHC -O2 #-} {-# LANGUAGE BangPatterns #-} import Control.Applicative import qualified Data.ByteString.Char8 as B import qualified Data.IntSet as IS readInt :: B.ByteString -> Int readInt bs = case B.readInt bs of Just (n,_) -> n main :: IO () main = do n <- readLn xs <- map readInt.B.words <$> B.getLine print $ solve n xs solve :: Int -> [Int] -> Int solve n xs = go (IS.singleton 0) xs where go !s (x:xs) = go (IS.union s $ IS.map (x+) s) xs go !s _ = IS.size s
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | cojna |
Language | Haskell (GHC 7.4.1) |
Score | 2 |
Code Size | 521 Byte |
Status | AC |
Exec Time | 127 ms |
Memory | 4152 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 2 / 2 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 00, 01, 02, 90, 91 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00 | AC | 44 ms | 1460 KB |
01 | AC | 48 ms | 3120 KB |
02 | AC | 127 ms | 4152 KB |
90 | AC | 23 ms | 1296 KB |
91 | AC | 22 ms | 1296 KB |