結果
問題 |
No.741 AscNumber(Easy)
|
ユーザー |
![]() |
提出日時 | 2021-01-02 02:44:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 262 ms / 2,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 1,746 ms |
コンパイル使用メモリ | 191,812 KB |
最終ジャッジ日時 | 2025-01-17 08:57:11 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1000000007; ll dp[1000005][10]; int main() { int N; cin >> N; dp[0][0] = 1; for (int i = 1; i <= N; i++) { for (int j = 0; j < 10; j++) { for (int d = 0; d < 10; d++) { if (d <= j) { dp[i][j] += dp[i - 1][d]; dp[i][j] %= mod; } } } } ll ans = 0; for (int i = 0; i < 10; i++) { ans += dp[N][i]; ans %= mod; } cout << ans << endl; return 0; }