結果
問題 |
No.741 AscNumber(Easy)
|
ユーザー |
![]() |
提出日時 | 2018-10-13 15:32:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 498 ms |
コンパイル使用メモリ | 64,740 KB |
実行使用メモリ | 42,552 KB |
最終ジャッジ日時 | 2024-10-12 18:04:02 |
合計ジャッジ時間 | 1,866 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
ソースコード
#include<iostream> using namespace std; int n; int dp[1000010][10]; int main() { int mod=1e9+7; cin >> n; for(int j=0;j<10;j++) dp[1][j]=j+1; for(int i=1;i<=n;i++) dp[i][0]=1; for(int i=2;i<=n;i++) { for(int j=1;j<10;j++) { dp[i][j]=dp[i-1][j]+dp[i][j-1]; dp[i][j]%=mod; } } cout << dp[n][9] << endl; return 0; }