結果
| 問題 |
No.741 AscNumber(Easy)
|
| コンテスト | |
| ユーザー |
Naco
|
| 提出日時 | 2019-10-08 23:26:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 149 ms / 2,000 ms |
| コード長 | 494 bytes |
| コンパイル時間 | 1,471 ms |
| コンパイル使用メモリ | 166,328 KB |
| 実行使用メモリ | 81,408 KB |
| 最終ジャッジ日時 | 2024-11-07 22:36:46 |
| 合計ジャッジ時間 | 5,044 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 55 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
static const int MOD=1e9+7;
int main(){
int N; cin >> N;
ll dp[N+1][10];
memset(dp,0,sizeof(dp));
for(int i=0;i<10;i++) dp[0][i]=1;
for(int i=0;i<N;i++){
for(int j=0;j<10;j++){
for(int k=j;k<10;k++){
dp[i+1][k]+=dp[i][j]%MOD;
}
}
}
long long ans=0;
for(int i=0;i<10;i++){
ans+=dp[N-1][i]%MOD;
}
cout << ans%MOD << endl;
}
Naco