結果

問題 No.741 AscNumber(Easy)
ユーザー SSRSSSRS
提出日時 2020-11-26 07:40:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 70,780 KB
実行使用メモリ 120,072 KB
最終ジャッジ日時 2023-10-01 03:14:17
合計ジャッジ時間 4,344 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,388 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 139 ms
114,924 KB
testcase_36 AC 62 ms
51,716 KB
testcase_37 AC 74 ms
60,292 KB
testcase_38 AC 72 ms
59,596 KB
testcase_39 AC 60 ms
50,692 KB
testcase_40 AC 82 ms
68,108 KB
testcase_41 AC 128 ms
104,916 KB
testcase_42 AC 67 ms
56,852 KB
testcase_43 AC 49 ms
41,924 KB
testcase_44 AC 99 ms
82,900 KB
testcase_45 AC 108 ms
89,128 KB
testcase_46 AC 127 ms
109,280 KB
testcase_47 AC 24 ms
20,884 KB
testcase_48 AC 131 ms
109,356 KB
testcase_49 AC 107 ms
91,740 KB
testcase_50 AC 17 ms
14,936 KB
testcase_51 AC 52 ms
43,936 KB
testcase_52 AC 144 ms
120,072 KB
testcase_53 AC 142 ms
120,060 KB
testcase_54 AC 142 ms
118,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
const long long MOD = 1000000007;
int main(){
	int N;
	cin >> N;
	vector<vector<long long>> dp(N + 1, vector<long long>(10, 0));
	dp[0][0] = 1;
	for (int i = 0; i < N; i++){
		long long sum = 0;
		for (int j = 0; j < 10; j++){
			sum += dp[i][j];
			sum %= MOD;
			dp[i + 1][j] = sum;
		}
	}
	long long ans = 0;
	for (int i = 0; i < 10; i++){
		ans += dp[N][i];
	}
	ans %= MOD;
	cout << ans << endl;
}
0