結果

問題 No.888 約数の総和
ユーザー kou_kkk
提出日時 2025-09-14 21:42:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 4,408 ms
コンパイル使用メモリ 117,228 KB
実行使用メモリ 27,872 KB
最終ジャッジ日時 2025-09-14 21:42:35
合計ジャッジ時間 7,110 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
 
class Program
{
    static void Main()
    {
        var n = long.Parse(Console.ReadLine());
        var rootN = (int) Math.Sqrt(n);
        var ans =
            (from i in Enumerable.Range(1, rootN)
             where n % i == 0
             let arr = new []{ 0, i, n / i }
             select (from j in Enumerable.Range(1, 2)
                     where arr[j] != arr[j-1]
                     select arr[j]
                    ).Sum()
            ).Sum();
 
        Console.Write(ans);
    }
}
0