結果
| 問題 |
No.278 連続する整数の和(2)
|
| コンテスト | |
| ユーザー |
aimy
|
| 提出日時 | 2017-06-17 09:54:29 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 52 ms / 2,000 ms |
| コード長 | 249 bytes |
| コンパイル時間 | 4,652 ms |
| コンパイル使用メモリ | 176,000 KB |
| 実行使用メモリ | 8,064 KB |
| 最終ジャッジ日時 | 2024-12-23 09:13:53 |
| 合計ジャッジ時間 | 2,676 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
コンパイルメッセージ
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
ソースコード
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