結果

問題 No.2051 Divide
ユーザー Maeda
提出日時 2025-04-15 10:01:36
言語 C#
(.NET 8.0.404)
結果
TLE  
実行時間 -
コード長 745 bytes
コンパイル時間 10,453 ms
コンパイル使用メモリ 169,436 KB
実行使用メモリ 46,784 KB
最終ジャッジ日時 2025-04-15 10:01:53
合計ジャッジ時間 14,073 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 TLE * 1 -- * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (137 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num.ToString()));
            IEnumerable<int> divisors = from i in Enumerable.Range(1, n[0])
                           where n[0] % i == 0
                           select i;

            Console.WriteLine(MultipleCount(divisors, n[1]));
        }

        private static int MultipleCount(IEnumerable<int> divisors, int v)
        {
            int count = 0;
            foreach (int i in divisors)
            {
                if (i % v == 0 && i / v >= 1)
                {
                    count++;
                }
            }
            return count;
        }
    }
0