結果
問題 | No.1581 Multiple Sequence |
ユーザー | chestnut_68 |
提出日時 | 2021-07-02 22:23:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 241 ms / 2,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 4,184 ms |
コンパイル使用メモリ | 230,236 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 12:07:11 |
合計ジャッジ時間 | 7,742 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint1000000007; using namespace std; const int MOD=1e9+7; const long long INF = 1LL<<60; int main(){ int64_t M;cin>>M; vector<mint> A(M+1,1); for(int64_t i=2;i<=M;A[i]+=A[i-1],i++){ for(int64_t j=2;j*j<=i;j++){ if(i%j==0){ A[i]+=A[j-1]; if(j!=i/j)A[i]+=A[i/j-1]; } } } cout<<A[M].val(); }