結果

問題 No.2417 Div Count
ユーザー 👑 kakel-sankakel-san
提出日時 2023-10-09 11:41:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 865 bytes
コンパイル時間 1,195 ms
コンパイル使用メモリ 68,200 KB
実行使用メモリ 26,036 KB
最終ジャッジ日時 2023-10-09 11:41:59
合計ジャッジ時間 6,478 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,848 KB
testcase_01 AC 61 ms
21,772 KB
testcase_02 AC 62 ms
19,944 KB
testcase_03 AC 64 ms
21,920 KB
testcase_04 AC 62 ms
21,840 KB
testcase_05 AC 63 ms
19,720 KB
testcase_06 AC 62 ms
21,844 KB
testcase_07 AC 62 ms
23,916 KB
testcase_08 AC 61 ms
19,920 KB
testcase_09 AC 61 ms
21,844 KB
testcase_10 AC 63 ms
23,976 KB
testcase_11 AC 63 ms
23,880 KB
testcase_12 AC 62 ms
21,912 KB
testcase_13 AC 62 ms
21,928 KB
testcase_14 AC 63 ms
21,816 KB
testcase_15 AC 62 ms
21,924 KB
testcase_16 AC 61 ms
21,896 KB
testcase_17 AC 63 ms
21,832 KB
testcase_18 AC 62 ms
23,932 KB
testcase_19 AC 62 ms
26,036 KB
testcase_20 AC 62 ms
21,940 KB
testcase_21 AC 62 ms
23,876 KB
testcase_22 AC 62 ms
23,956 KB
testcase_23 AC 61 ms
21,768 KB
testcase_24 AC 61 ms
21,844 KB
testcase_25 AC 61 ms
21,840 KB
testcase_26 AC 61 ms
21,944 KB
testcase_27 AC 62 ms
21,900 KB
testcase_28 AC 63 ms
23,928 KB
testcase_29 AC 62 ms
21,964 KB
testcase_30 AC 62 ms
21,948 KB
testcase_31 AC 62 ms
21,848 KB
testcase_32 AC 65 ms
21,924 KB
testcase_33 AC 63 ms
21,856 KB
testcase_34 AC 63 ms
21,844 KB
testcase_35 AC 66 ms
22,024 KB
testcase_36 AC 65 ms
23,900 KB
testcase_37 AC 65 ms
21,836 KB
testcase_38 AC 73 ms
23,968 KB
testcase_39 AC 67 ms
23,956 KB
testcase_40 AC 65 ms
21,920 KB
testcase_41 AC 64 ms
21,980 KB
testcase_42 AC 62 ms
21,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (n, k) = (c[0], c[1]);
        var ans = 0;
        foreach (var a in Divs(n - k))
        {
            if (n % a == k) ++ans;
        }
        WriteLine(ans);
    }
    static List<long> Divs(long n)
    {
        var list = new List<long>();
        for (var i = 1L; i * i <= n; ++i)
        {
            if (n % i == 0)
            {
                list.Add(i);
                if (i * i < n) list.Add(n / i);
            }
        }
        return list;
    }
}
0