結果

問題 No.1396 Giri
ユーザー kotatsugamekotatsugame
提出日時 2021-02-14 21:25:57
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 69,620 KB
実行使用メモリ 4,748 KB
最終ジャッジ日時 2023-09-29 14:28:29
合計ジャッジ時間 1,732 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 7 ms
4,616 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 8 ms
4,612 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 4 ms
4,380 KB
testcase_20 AC 6 ms
4,380 KB
testcase_21 AC 7 ms
4,584 KB
testcase_22 AC 7 ms
4,672 KB
testcase_23 AC 8 ms
4,748 KB
testcase_24 AC 8 ms
4,528 KB
testcase_25 AC 8 ms
4,604 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
using namespace std;
const long mod=998244353;
bool isp[1<<20];
int N;
main()
{
	cin>>N;
	vector<int>ps;
	for(int i=2;i<=N;i++)if(!isp[i])
	{
		ps.push_back(i);
		for(int j=i+i;j<=N;j+=i)isp[j]=true;
	}
	long ans=1;
	for(int i=0;i+1<ps.size();i++)
	{
		int t=N;
		while(t>=ps[i])
		{
			t/=ps[i];
			ans=ans*ps[i]%mod;
		}
	}
	cout<<ans<<endl;
}
0