結果
| 問題 |
No.1581 Multiple Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-28 17:02:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 723 bytes |
| コンパイル時間 | 840 ms |
| コンパイル使用メモリ | 81,316 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-20 06:40:16 |
| 合計ジャッジ時間 | 1,931 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<ctime>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
typedef long long LL;
const int MR=1e6+10;
const int MOD=1e9+7;
int x[MR];
int main(){
int M;
cin>>M;
x[0]=1;
/*
for(int k=1;k<=M;k++){
for(int i=1;i*i<=k;i++){
if(k%i!=0) continue;
x[k]+=x[k/i-1];
x[k]%=MOD;
if(i*i<k) x[k]+=x[i-1];
x[k]%=MOD;
}
}
*/
for(int i=1;i<=M;i++){
for(int k=i;k<=M;k+=i){
x[k]+=x[i-1];
x[k]%=MOD;
}
}
cout<<x[M]<<endl;
return 0;
}