結果
| 問題 | 
                            No.370 道路の掃除
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-05-13 22:43:40 | 
| 言語 | Haskell  (9.10.1)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 514 bytes | 
| コンパイル時間 | 6,689 ms | 
| コンパイル使用メモリ | 171,136 KB | 
| 実行使用メモリ | 8,064 KB | 
| 最終ジャッジ日時 | 2024-10-05 17:02:24 | 
| 合計ジャッジ時間 | 4,495 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 31 RE * 3 | 
コンパイルメッセージ
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
ソースコード
import Control.Monad.ST import Control.Monad import Data.Array.ST import Data.Array import Data.STRef import Control.Monad import Control.Applicative import Data.List getMin a b | a<0 && b<0 = negate a | a>0 && b>0 = b | otherwise = (b-a) + min (negate a) b ans n (a:as) c | c < n = 800000000 | otherwise = min (getMin a ((a:as) !! (n-1))) (ans n as (c-1)) main = do [n,m] <- map read <$> words <$> getLine ::IO [Int] b <- sort <$> map read <$> words <$> getContents ::IO [Int] print $ ans n b m