結果

問題 No.1396 Giri
ユーザー さかぽんさかぽん
提出日時 2021-02-15 05:43:14
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 3,914 ms
コンパイル使用メモリ 103,404 KB
実行使用メモリ 24,428 KB
最終ジャッジ日時 2023-09-29 23:53:27
合計ジャッジ時間 6,513 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,688 KB
testcase_01 AC 54 ms
20,628 KB
testcase_02 AC 65 ms
22,424 KB
testcase_03 AC 54 ms
20,684 KB
testcase_04 AC 55 ms
20,720 KB
testcase_05 AC 66 ms
24,428 KB
testcase_06 AC 55 ms
20,780 KB
testcase_07 AC 55 ms
22,648 KB
testcase_08 AC 54 ms
20,528 KB
testcase_09 AC 55 ms
20,580 KB
testcase_10 AC 53 ms
18,604 KB
testcase_11 AC 53 ms
20,608 KB
testcase_12 AC 53 ms
20,608 KB
testcase_13 AC 54 ms
20,632 KB
testcase_14 AC 54 ms
18,684 KB
testcase_15 AC 55 ms
22,624 KB
testcase_16 AC 54 ms
18,564 KB
testcase_17 AC 54 ms
22,724 KB
testcase_18 AC 56 ms
22,744 KB
testcase_19 AC 60 ms
19,320 KB
testcase_20 AC 61 ms
21,552 KB
testcase_21 AC 63 ms
22,292 KB
testcase_22 AC 65 ms
22,356 KB
testcase_23 AC 65 ms
22,312 KB
testcase_24 AC 65 ms
20,332 KB
testcase_25 AC 64 ms
22,440 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.Collections.Generic;

class B
{
	const long M = 998244353;
	static void Main()
	{
		var n = int.Parse(Console.ReadLine());

		var r = 1L;
		var ps = GetPrimes(n);

		for (int i = 0; i < ps.Length - 1; i++)
		{
			var p = ps[i];
			var t = 1L;
			while (t * p <= n) t *= p;
			r *= t;
			r %= M;
		}
		Console.WriteLine(r);
	}

	static int[] GetPrimes(int n)
	{
		var b = new bool[n + 1];
		for (int p = 2; p * p <= n; ++p) if (!b[p]) for (int x = p * p; x <= n; x += p) b[x] = true;
		var r = new List<int>();
		for (int x = 2; x <= n; ++x) if (!b[x]) r.Add(x);
		return r.ToArray();
	}
}
0