結果
| 問題 | No.278 連続する整数の和(2) |
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2015-11-17 16:00:29 |
| 言語 | Haskell (9.14.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 34 ms / 2,000 ms |
| + 37µs | |
| コード長 | 333 bytes |
| 記録 | |
| コンパイル時間 | 5,551 ms |
| コンパイル使用メモリ | 193,408 KB |
| 実行使用メモリ | 10,368 KB |
| 最終ジャッジ日時 | 2026-10-06 11:18:06 |
| 合計ジャッジ時間 | 7,170 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Data.List (nub)
divisors :: Integral a => a -> [a]
divisors 1 = [1]
divisors n = (1 :) $ (n :) $ nub $ concat [[x, d] |
x <- [2 .. l], let (d, m) = divMod n x, m == 0]
where l = floor $ sqrt $ fromIntegral n
main :: IO ()
main = print . sum .
divisors . (\n -> if odd n then n else div n 2) =<< readLn
はむ吉🐹