結果

問題 No.1581 Multiple Sequence
ユーザー chestnut_68chestnut_68
提出日時 2021-07-02 22:23:23
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 3,934 ms
コンパイル使用メモリ 227,692 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-11 22:32:24
合計ジャッジ時間 7,489 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 173 ms
4,376 KB
testcase_03 AC 193 ms
4,376 KB
testcase_04 AC 41 ms
4,380 KB
testcase_05 AC 204 ms
4,380 KB
testcase_06 AC 77 ms
4,380 KB
testcase_07 AC 39 ms
4,380 KB
testcase_08 AC 57 ms
4,380 KB
testcase_09 AC 180 ms
4,380 KB
testcase_10 AC 110 ms
4,376 KB
testcase_11 AC 18 ms
4,376 KB
testcase_12 AC 64 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 196 ms
4,376 KB
testcase_15 AC 131 ms
4,380 KB
testcase_16 AC 23 ms
4,376 KB
testcase_17 AC 220 ms
4,380 KB
testcase_18 AC 14 ms
4,384 KB
testcase_19 AC 166 ms
4,380 KB
testcase_20 AC 175 ms
4,376 KB
testcase_21 AC 192 ms
4,500 KB
testcase_22 AC 96 ms
4,380 KB
testcase_23 AC 228 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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();
}
0