結果

問題 No.741 AscNumber(Easy)
ユーザー ant2357ant2357
提出日時 2018-10-10 20:41:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 851 bytes
コンパイル時間 1,959 ms
コンパイル使用メモリ 198,276 KB
実行使用メモリ 73,552 KB
最終ジャッジ日時 2024-04-20 19:29:58
合計ジャッジ時間 4,829 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 115 ms
70,364 KB
testcase_36 AC 51 ms
32,324 KB
testcase_37 AC 61 ms
37,632 KB
testcase_38 AC 59 ms
37,228 KB
testcase_39 AC 51 ms
31,848 KB
testcase_40 AC 67 ms
42,112 KB
testcase_41 AC 107 ms
64,512 KB
testcase_42 AC 58 ms
35,712 KB
testcase_43 AC 43 ms
26,604 KB
testcase_44 AC 84 ms
51,100 KB
testcase_45 AC 89 ms
54,912 KB
testcase_46 AC 110 ms
67,072 KB
testcase_47 AC 20 ms
14,080 KB
testcase_48 AC 109 ms
66,944 KB
testcase_49 AC 93 ms
56,560 KB
testcase_50 AC 14 ms
10,496 KB
testcase_51 AC 43 ms
27,788 KB
testcase_52 AC 122 ms
73,492 KB
testcase_53 AC 122 ms
73,552 KB
testcase_54 AC 122 ms
72,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;

const double PI = 3.1415926535897932384626433832795;

const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { -1, 0, 1, 0 };

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

const ll MOD = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n;
	cin >> n;

	vector<vector<int>> dp(n + 1, vector<int>(10));
	for (int i = 0; i <= n; i++) {
		dp[i][0] = 1;
	}

	for (int i = 0; i < 10; i++) {
		dp[0][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]) % MOD;
		}
	}

	cout << dp[n][9] << endl;
	return 0;
}
0