結果
問題 | No.741 AscNumber(Easy) |
ユーザー |
![]() |
提出日時 | 2018-10-06 11:23:24 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 205 ms / 2,000 ms |
コード長 | 1,617 bytes |
コンパイル時間 | 1,148 ms |
コンパイル使用メモリ | 158,200 KB |
実行使用メモリ | 89,344 KB |
最終ジャッジ日時 | 2024-10-12 13:43:59 |
合計ジャッジ時間 | 5,044 ms |
ジャッジサーバーID (参考情報) |
judge / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;#define tr(container, it) \for (auto it = container.begin(); it != container.end(); it++)#define scontains(c, x) ((c).find(x) != (c).end()) //O(log n)#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)#define ill(_x) ll _x;scanf("%lld",&_x);#define idb(_x) double _x;scanf("%lf",&_x);#define all(x) (x).begin(),(x).end()#define pll pair<ll,ll>#define mll map<ll,ll>#define vll vector<ll>#define sll set<ll>#define vs vector<string>#define in0(x, a, b)((x)>=a && (x)<=b )#define in1(x, a, b)((x)>a && (x)<b)#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))#define gcd __gcdconst double pi = 3.14159265358979323846;const int INF = 0x3f3f3f3f;const int MOD = (int)(1e9+7);ll dp[1000002][11];void _(){int n;cin >> n;for (int i = 0; i < 10; ++i) {dp[0][i] = 1;}for (int i = 1; i < n+3; ++i) {for (int j = 1; j < 10; ++j) {for (int k = 1; k <=j; ++k) {dp[i][j] += dp[i-1][k];dp[i][j] %= MOD;}}}ll ans = 0;for (int i = 0; i < n + 1; ++i) {ans += dp[i][9];ans %= MOD;}cout << ans;}int main() {#ifdef Debugfreopen("/home/joduskame/Desktop/cpp/IO/Input.txt", "r", stdin);freopen("/home/joduskame/Desktop/cpp/IO/Output.txt", "w", stdout);#endifios_base::sync_with_stdio(false);cin.tie(NULL);_();return 0;}