結果

問題 No.888 約数の総和
ユーザー curryudon08curryudon08
提出日時 2020-07-03 17:07:23
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 612 bytes
コンパイル時間 1,907 ms
コンパイル使用メモリ 102,452 KB
実行使用メモリ 23,080 KB
最終ジャッジ日時 2023-10-14 23:46:08
合計ジャッジ時間 5,481 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,024 KB
testcase_01 AC 56 ms
18,832 KB
testcase_02 AC 57 ms
20,916 KB
testcase_03 AC 57 ms
20,792 KB
testcase_04 AC 57 ms
20,924 KB
testcase_05 AC 56 ms
22,852 KB
testcase_06 AC 56 ms
20,812 KB
testcase_07 AC 56 ms
20,856 KB
testcase_08 AC 55 ms
20,692 KB
testcase_09 AC 57 ms
22,776 KB
testcase_10 AC 54 ms
23,080 KB
testcase_11 AC 55 ms
20,784 KB
testcase_12 AC 57 ms
20,860 KB
testcase_13 AC 55 ms
20,680 KB
testcase_14 AC 56 ms
20,920 KB
testcase_15 AC 54 ms
20,912 KB
testcase_16 AC 58 ms
20,820 KB
testcase_17 AC 58 ms
20,808 KB
testcase_18 AC 68 ms
18,804 KB
testcase_19 AC 64 ms
22,760 KB
testcase_20 AC 60 ms
20,876 KB
testcase_21 AC 64 ms
20,784 KB
testcase_22 AC 63 ms
18,980 KB
testcase_23 AC 53 ms
20,928 KB
testcase_24 AC 58 ms
18,888 KB
testcase_25 AC 61 ms
18,804 KB
testcase_26 AC 60 ms
20,856 KB
testcase_27 AC 62 ms
18,812 KB
testcase_28 AC 62 ms
20,708 KB
testcase_29 AC 62 ms
20,860 KB
testcase_30 AC 62 ms
21,020 KB
testcase_31 AC 63 ms
20,876 KB
testcase_32 AC 68 ms
20,988 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Numerics;

namespace _0888
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = long.Parse(Console.ReadLine());
            var x = DivisorSum(n);
            Console.WriteLine(x);
        }

        static BigInteger DivisorSum(long n){
            BigInteger s = 0;
            for(var i = 1L; i * i <= n; i++){
                if(n % i == 0){
                    s += i;
                    if(i * i != n){
                        s += (n / i);
                    }
                }
            }
            return s;
        }
    }
}
0