結果

問題 No.741 AscNumber(Easy)
ユーザー aonek0aonek0
提出日時 2019-05-25 13:01:37
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 1,071 bytes
コンパイル時間 721 ms
コンパイル使用メモリ 93,060 KB
実行使用メモリ 81,712 KB
最終ジャッジ日時 2023-10-17 17:42:21
合計ジャッジ時間 2,871 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 1 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 1 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 1 ms
4,348 KB
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 48 ms
80,032 KB
testcase_36 AC 21 ms
37,024 KB
testcase_37 AC 24 ms
43,168 KB
testcase_38 AC 24 ms
43,168 KB
testcase_39 AC 20 ms
37,024 KB
testcase_40 AC 26 ms
47,264 KB
testcase_41 AC 40 ms
71,840 KB
testcase_42 AC 22 ms
41,120 KB
testcase_43 AC 17 ms
30,880 KB
testcase_44 AC 32 ms
57,504 KB
testcase_45 AC 35 ms
61,600 KB
testcase_46 AC 42 ms
75,936 KB
testcase_47 AC 9 ms
16,544 KB
testcase_48 AC 43 ms
75,936 KB
testcase_49 AC 36 ms
63,648 KB
testcase_50 AC 7 ms
12,448 KB
testcase_51 AC 18 ms
32,928 KB
testcase_52 AC 47 ms
81,712 KB
testcase_53 AC 47 ms
81,712 KB
testcase_54 AC 46 ms
80,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include <iomanip>
#include<map>
#include <random>
#include<type_traits>
#include<stack>
#include <sstream> 
#include <limits>
#include <numeric>
#include<string.h>
using namespace std;
#define ll long long int
#define all(v) begin(v), end(v)
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)
//typedef vector<int> V;
//typedef vector<V> VV;
//typedef vector<VV> VVV;
using namespace std;


long long int dp[1000005][10];

long long int solve(long long int N) {
	for (int i = 0; i < 10; i++) {
		dp[1][i] = 1;
	}
	for(long long int i = 1; i < N; i++) {
		long long int sum = 0;
		for (int j = 9; j>=0; j--) {
			sum += dp[i][j];
			sum %= 1000000007;
			dp[i + 1][j] = sum;
		}
	}
	long long int res = 0;
	for (int i = 0; i < 10; i++) {
		res += dp[N][i];
	}
	return res%1000000007;
}

int main() {
	int N;
	cin >> N;
	cout<<solve(N)<<endl;
}
0