結果

問題 No.741 AscNumber(Easy)
ユーザー hide1214hide1214
提出日時 2018-10-11 16:32:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 219 ms / 2,000 ms
コード長 1,540 bytes
コンパイル時間 744 ms
コンパイル使用メモリ 89,264 KB
実行使用メモリ 89,600 KB
最終ジャッジ日時 2024-04-20 19:42:46
合計ジャッジ時間 4,795 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 AC 1 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 2 ms
6,944 KB
testcase_26 AC 1 ms
6,944 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 2 ms
6,944 KB
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 2 ms
6,940 KB
testcase_31 AC 1 ms
6,940 KB
testcase_32 AC 2 ms
6,944 KB
testcase_33 AC 2 ms
6,944 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 209 ms
85,504 KB
testcase_36 AC 89 ms
39,168 KB
testcase_37 AC 104 ms
45,440 KB
testcase_38 AC 102 ms
45,056 KB
testcase_39 AC 90 ms
38,528 KB
testcase_40 AC 133 ms
51,072 KB
testcase_41 AC 186 ms
78,336 KB
testcase_42 AC 101 ms
43,008 KB
testcase_43 AC 74 ms
32,128 KB
testcase_44 AC 143 ms
61,952 KB
testcase_45 AC 167 ms
66,688 KB
testcase_46 AC 200 ms
81,536 KB
testcase_47 AC 35 ms
16,768 KB
testcase_48 AC 195 ms
81,408 KB
testcase_49 AC 168 ms
68,608 KB
testcase_50 AC 24 ms
12,288 KB
testcase_51 AC 80 ms
33,664 KB
testcase_52 AC 219 ms
89,600 KB
testcase_53 AC 211 ms
89,600 KB
testcase_54 AC 208 ms
88,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>
#include<numeric>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define SUM(a) accumulate(all(a),0LL)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld\n",x)
#define print2(x) printf("%lld ",x)
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 2222222222222222222LL;
const ll mod = 1000000007LL;

ll n = 0, m = 0, ans = 0, cnt = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok = true, flag = false;
ll dx[5] = { 1,-1,0,0,0 }, dy[5] = { 0,0,1,-1,0 };
ll ddx[9] = { 1,-1,0,0,1,1,-1,-1,0 }, ddy[9] = { 0,0,1,-1,1,-1,1,-1,0 };
#pragma endregion
#define MAX 111111

ll dp[MAX * 10][11];

int main(void) {
  cin >> n;
  rep(i, 10) dp[0][i] = 1;
  FOR(i, 1, n) {
	rep(j, 10) {
	  rep(k, j + 1) (dp[i][j] += dp[i - 1][k]) %= mod;
	}
  }
  rep(i, 10) (ans += dp[n - 1][i]) %= mod;
  cout << ans << endl;

  return 0;
}
0