結果

問題 No.2750 Number of Prime Factors
ユーザー 👑 kakel-sankakel-san
提出日時 2024-05-21 00:32:26
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 902 bytes
コンパイル時間 11,071 ms
コンパイル使用メモリ 165,268 KB
実行使用メモリ 182,124 KB
最終ジャッジ日時 2024-05-21 00:32:40
合計ジャッジ時間 11,581 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 51 ms
28,672 KB
testcase_02 AC 51 ms
28,672 KB
testcase_03 AC 51 ms
28,928 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 51 ms
29,056 KB
testcase_07 AC 52 ms
28,928 KB
testcase_08 AC 53 ms
28,928 KB
testcase_09 AC 51 ms
28,672 KB
testcase_10 WA -
testcase_11 AC 51 ms
28,672 KB
testcase_12 WA -
testcase_13 AC 51 ms
28,628 KB
testcase_14 WA -
testcase_15 AC 51 ms
29,056 KB
testcase_16 WA -
testcase_17 AC 51 ms
28,672 KB
testcase_18 WA -
testcase_19 AC 51 ms
29,056 KB
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (118 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

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

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = long.Parse(ReadLine());
        var p = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };
        var a = 2L;
        for (var i = 0; i < p.Length; ++i)
        {
            if (n < a * p[i])
            {
                WriteLine(i + 1);
                return;
            }
            a *= p[i];
        }
    }
}
0