結果
| 問題 | No.741 AscNumber(Easy) | 
| コンテスト | |
| ユーザー |  veqcc | 
| 提出日時 | 2019-02-26 17:01:39 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 180 ms / 2,000 ms | 
| コード長 | 777 bytes | 
| コンパイル時間 | 868 ms | 
| コンパイル使用メモリ | 91,080 KB | 
| 実行使用メモリ | 81,664 KB | 
| 最終ジャッジ日時 | 2024-06-23 02:04:48 | 
| 合計ジャッジ時間 | 4,904 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 55 | 
ソースコード
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;
const ll MOD = 1000000007LL;
ll dp[1000000][10];
// i: 上からi桁目まで見て
// k: 直前の数
// の時の総数
int main() {
    int n;
    cin >> n;
    dp[0][0] = 1;
    for (int i = 0; i < n; i++) {
        for (int k = 0; k < 10; k++) {
            for (int d = k; d < 10; d++) {
                (dp[i+1][d] += dp[i][k]) %= MOD;
            }
        }
    }
    ll ans = 0LL;
    for (int k = 0; k < 10; k++) {
        (ans += dp[n][k]) %= MOD;
    }
    cout << ans << "\n";
    return 0;
}
            
            
            
        