結果
| 問題 |
No.1396 Giri
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-14 21:25:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 382 bytes |
| コンパイル時間 | 692 ms |
| コンパイル使用メモリ | 69,760 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 08:40:34 |
| 合計ジャッジ時間 | 1,570 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main()
| ^~~~
ソースコード
#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;
}