結果
問題 | No.741 AscNumber(Easy) |
ユーザー |
|
提出日時 | 2018-10-05 21:31:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 727 ms / 2,000 ms |
コード長 | 577 bytes |
コンパイル時間 | 482 ms |
コンパイル使用メモリ | 65,264 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 12:53:42 |
合計ジャッジ時間 | 10,952 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
ソースコード
#include<iostream>using namespace std;typedef long long ll;ll mod = 1e9 + 7;int main(){int n;cin >> n;ll dp[10] = {};for(int i = 0; i < 10; i++) dp[i] = 1;for(int i = 1; i < n; i++){ll next[10] = {};for(int j = 0; j < 10; j++){for(int k = 0; k <= j; k++){next[j] = (next[j] + dp[k]) % mod;}}for(int i = 0; i < 10; i++) dp[i] = next[i];}ll ans = 1;for(int i = 1; i < 10; i++) ans = (ans + dp[i]) % mod;cout << ans << endl;return 0;}