結果
問題 |
No.40 多項式の割り算
|
ユーザー |
![]() |
提出日時 | 2014-10-14 23:59:52 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 449 bytes |
コンパイル時間 | 2,719 ms |
コンパイル使用メモリ | 174,080 KB |
実行使用メモリ | 11,904 KB |
最終ジャッジ日時 | 2024-12-30 09:09:05 |
合計ジャッジ時間 | 4,546 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 32 |
コンパイルメッセージ
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 Data.List import Control.Applicative import Control.Monad main = do _ <- getLine bs <- map read. words <$> getLine let ans = solve bs putStrLn. unwords. map show$ ans solve bs = reverse. canonicalize. rec. reverse$ bs where rec (x3:x2:x1:x0:xs) = rec (x2:(x1+x3):x0:xs) rec xs = xs canonicalize xs | all (0==) xs = [0] | otherwise = dropWhile (==0) xs