結果

問題 No.1396 Giri
ユーザー 👑 ygussanyygussany
提出日時 2021-02-14 21:41:46
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 1,277 ms
コンパイル使用メモリ 28,412 KB
実行使用メモリ 6,048 KB
最終ジャッジ日時 2023-09-29 14:58:02
合計ジャッジ時間 2,243 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,712 KB
testcase_01 AC 2 ms
5,636 KB
testcase_02 AC 10 ms
6,020 KB
testcase_03 AC 2 ms
5,608 KB
testcase_04 AC 2 ms
5,716 KB
testcase_05 AC 10 ms
6,024 KB
testcase_06 AC 2 ms
5,712 KB
testcase_07 AC 2 ms
5,696 KB
testcase_08 AC 2 ms
5,808 KB
testcase_09 AC 2 ms
5,708 KB
testcase_10 AC 2 ms
5,668 KB
testcase_11 AC 2 ms
5,708 KB
testcase_12 AC 2 ms
5,716 KB
testcase_13 AC 2 ms
5,708 KB
testcase_14 AC 2 ms
5,628 KB
testcase_15 AC 2 ms
5,708 KB
testcase_16 AC 2 ms
5,724 KB
testcase_17 AC 3 ms
5,708 KB
testcase_18 AC 3 ms
5,724 KB
testcase_19 AC 6 ms
5,836 KB
testcase_20 AC 7 ms
5,972 KB
testcase_21 AC 10 ms
6,000 KB
testcase_22 AC 10 ms
6,048 KB
testcase_23 AC 10 ms
6,032 KB
testcase_24 AC 9 ms
5,988 KB
testcase_25 AC 11 ms
6,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

const int Mod = 998244353;

int main()
{
	int N;
	scanf("%d", &N);
	
	int i, j, k, l, n, flag[1000001] = {}, p[100001];
	for (i = 2, k = 0; i <= N; i++) {
		if (flag[i] == 0) {
			p[k++] = i;
			for (j = i * 2; j <= N; j += i) flag[j] = 1;
		}
	}
	
	long long ans = 1, tmp;
	for (i = 0; i < k - 1; i++) {
		for (tmp = 1; tmp <= N; tmp *= p[i]);
		ans = ans * (tmp / p[i]) % Mod;
	}
	printf("%lld\n", ans);
	fflush(stdout);
	return 0;
}
0