結果
問題 |
No.1581 Multiple Sequence
|
ユーザー |
|
提出日時 | 2021-07-03 13:54:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 83 ms / 2,000 ms |
コード長 | 340 bytes |
コンパイル時間 | 553 ms |
コンパイル使用メモリ | 67,288 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 05:49:48 |
合計ジャッジ時間 | 2,290 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1E6+10,mod = 1e9+7; int f[N]; int main(){ int n; scanf("%d",&n); f[0]=1; for(int i=1;i<=n;i++){ for(int j=1;j*j<=i;j++){ if(i%j==0){ f[i]+=f[i/j-1]; if(j*j!=i) f[i]+=f[j-1]; f[i]%=mod; } } } cout<<f[n]; return 0; }