結果
| 問題 |
No.754 畳み込みの和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-02 04:44:30 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 754 ms / 5,000 ms |
| コード長 | 338 bytes |
| コンパイル時間 | 8,506 ms |
| コンパイル使用メモリ | 173,672 KB |
| 実行使用メモリ | 160,512 KB |
| 最終ジャッジ日時 | 2024-06-27 15:45:47 |
| 合計ジャッジ時間 | 5,424 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 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
ソースコード
-- Try yukicoder
-- author: Leonardone @ NEETSDKASU
main = interact $ show . solve . map read . words
mod109 = (`mod` (10^9 + 7))
solve (n:vs) = ans where
(xs, ys) = splitAt (n+1) vs
zs = zip xs (reverse ys)
ans = fst $ foldl f (0, 0) zs
f (a, s) (x, y) = (mod109 $ a + (mod109 $ y * (mod109 $ s + x)), mod109 $ s + x)