結果

問題 No.5 数字のブロック
ユーザー kuuso1
提出日時 2015-04-09 21:53:56
言語 Haskell
(9.10.1)
結果
AC  
実行時間 22 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 9,845 ms
コンパイル使用メモリ 176,328 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-11-17 22:35:46
合計ジャッジ時間 11,103 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 10 further locations.
    Suggested fix: Please use spaces instead.
  |
7 |         
  | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Monad
import Control.Applicative
import Data.List

main::IO()
main=do
	
	l <- readLn 
	n <- readLn ::IO Int
	aa <- (map read . words) <$> getLine
	
	let sa=sort aa
	putStrLn $ show (solve sa l)
	
solve :: [Int] -> Int -> Int
solve [] y = 0
solve (x:xs) y
	| x<=y = 1+solve xs (y-x)
	|otherwise = 0
	
0