結果
| 問題 | No.278 連続する整数の和(2) |
| コンテスト | |
| ユーザー |
aimy
|
| 提出日時 | 2017-06-17 09:54:29 |
| 言語 | Haskell (9.14.1) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 2,000 ms |
| コード長 | 249 bytes |
| 記録 | |
| コンパイル時間 | 1,050 ms |
| コンパイル使用メモリ | 197,120 KB |
| 実行使用メモリ | 10,368 KB |
| 最終ジャッジ日時 | 2026-05-29 10:27:15 |
| 合計ジャッジ時間 | 2,528 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_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
ソースコード
main = readLn >>= print . xsum xsum :: Integer -> Integer xsum n = foldr dsum 0 [1 .. floor (sqrt (fromIntegral d))] where dsum x acc = let (q,r) = divMod d x in if r/=0 then acc else if x==q then acc+x else acc+x+q d = gcd n (div (n*(n-1)) 2)
aimy