結果

問題 No.40 多項式の割り算
ユーザー LeonardoneLeonardone
提出日時 2015-12-09 08:41:12
言語 Haskell
(9.8.2)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 10,275 ms
コンパイル使用メモリ 163,612 KB
実行使用メモリ 14,496 KB
最終ジャッジ日時 2023-10-12 22:44:50
合計ジャッジ時間 11,985 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,992 KB
testcase_01 AC 3 ms
7,172 KB
testcase_02 AC 3 ms
7,188 KB
testcase_03 AC 3 ms
7,096 KB
testcase_04 AC 23 ms
13,352 KB
testcase_05 AC 32 ms
14,060 KB
testcase_06 AC 33 ms
14,304 KB
testcase_07 AC 32 ms
14,296 KB
testcase_08 AC 4 ms
8,952 KB
testcase_09 AC 22 ms
14,056 KB
testcase_10 AC 32 ms
14,220 KB
testcase_11 AC 22 ms
13,180 KB
testcase_12 AC 23 ms
12,392 KB
testcase_13 AC 33 ms
14,408 KB
testcase_14 AC 22 ms
13,436 KB
testcase_15 AC 22 ms
13,312 KB
testcase_16 AC 33 ms
14,340 KB
testcase_17 AC 12 ms
11,884 KB
testcase_18 AC 32 ms
13,744 KB
testcase_19 AC 32 ms
14,496 KB
testcase_20 AC 22 ms
13,096 KB
testcase_21 AC 12 ms
11,680 KB
testcase_22 AC 12 ms
11,416 KB
testcase_23 AC 22 ms
13,088 KB
testcase_24 AC 33 ms
14,068 KB
testcase_25 AC 2 ms
7,160 KB
testcase_26 AC 3 ms
7,172 KB
testcase_27 AC 3 ms
7,116 KB
testcase_28 AC 3 ms
6,940 KB
testcase_29 AC 2 ms
7,100 KB
testcase_30 AC 3 ms
7,164 KB
testcase_31 AC 3 ms
7,176 KB
testcase_32 AC 3 ms
7,076 KB
testcase_33 AC 3 ms
7,148 KB
testcase_34 AC 2 ms
7,164 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

-- yukicoder My Practice
-- author: Leonardone @ NEETSDKASU

import Data.List

main = putStr . str . f . map read . words =<< getContents
    where
        str (d, b) = unlines [show d, unwords . map show $ b]
        f (d:a) = solve d $ reverse a

solve d xs | d < 3 = ((ln - 1), zs)
    where
        f (0:e:es) = f (e:es)
        f es       = es
        zs = reverse $ f xs
        ln = length zs

solve d (a:b:c:xs) = solve (d - 1) (b:(c + a):xs)
0