結果
問題 |
No.741 AscNumber(Easy)
|
ユーザー |
![]() |
提出日時 | 2018-11-22 16:43:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 563 bytes |
コンパイル時間 | 1,908 ms |
コンパイル使用メモリ | 168,072 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-12-24 17:41:08 |
合計ジャッジ時間 | 10,072 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 RE * 20 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long lint; const int MAX_N = 1e5; lint MOD = 1e9 + 7, dp[MAX_N+5][10]; int main(){ int n; cin >> n; for(int i=0;i<10;i++) dp[0][i] = i + 1; for(int i=1;i<n;i++){ for(int j=1;j<10;j++){ dp[i][j] += dp[i][j-1] - dp[i-1][j-1] + dp[i-1][9]; dp[i][j] %= MOD; if(dp[i][j]<0) dp[i][j] += MOD; } } lint ans = 0; for(int i=0;i<n;i++){ ans += dp[i][9]; ans %= MOD; } cout << ans << endl; return 0; }