結果

問題 No.741 AscNumber(Easy)
ユーザー chocopuuchocopuu
提出日時 2018-10-05 21:55:54
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 986 bytes
コンパイル時間 1,683 ms
コンパイル使用メモリ 163,408 KB
実行使用メモリ 81,768 KB
最終ジャッジ日時 2024-04-20 17:13:36
合計ジャッジ時間 5,539 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
81,508 KB
testcase_01 AC 21 ms
81,564 KB
testcase_02 AC 22 ms
81,604 KB
testcase_03 AC 21 ms
81,600 KB
testcase_04 AC 22 ms
81,496 KB
testcase_05 AC 21 ms
81,480 KB
testcase_06 AC 21 ms
81,656 KB
testcase_07 AC 21 ms
81,608 KB
testcase_08 AC 21 ms
81,540 KB
testcase_09 AC 22 ms
81,624 KB
testcase_10 AC 21 ms
81,436 KB
testcase_11 AC 22 ms
81,604 KB
testcase_12 AC 21 ms
81,556 KB
testcase_13 AC 21 ms
81,628 KB
testcase_14 AC 21 ms
81,688 KB
testcase_15 AC 21 ms
81,560 KB
testcase_16 AC 22 ms
81,668 KB
testcase_17 AC 22 ms
81,672 KB
testcase_18 AC 21 ms
81,532 KB
testcase_19 AC 22 ms
81,604 KB
testcase_20 AC 22 ms
81,704 KB
testcase_21 AC 22 ms
81,752 KB
testcase_22 AC 22 ms
81,660 KB
testcase_23 AC 21 ms
81,484 KB
testcase_24 AC 21 ms
81,580 KB
testcase_25 AC 21 ms
81,476 KB
testcase_26 AC 21 ms
81,488 KB
testcase_27 AC 22 ms
81,572 KB
testcase_28 AC 21 ms
81,680 KB
testcase_29 AC 21 ms
81,528 KB
testcase_30 AC 22 ms
81,768 KB
testcase_31 AC 22 ms
81,552 KB
testcase_32 AC 22 ms
81,532 KB
testcase_33 AC 22 ms
81,576 KB
testcase_34 AC 22 ms
81,636 KB
testcase_35 AC 154 ms
81,416 KB
testcase_36 AC 80 ms
81,632 KB
testcase_37 AC 92 ms
81,660 KB
testcase_38 AC 90 ms
81,524 KB
testcase_39 AC 79 ms
81,556 KB
testcase_40 AC 97 ms
81,492 KB
testcase_41 AC 141 ms
81,592 KB
testcase_42 AC 83 ms
81,684 KB
testcase_43 AC 68 ms
81,688 KB
testcase_44 AC 117 ms
81,600 KB
testcase_45 AC 127 ms
81,536 KB
testcase_46 AC 148 ms
81,756 KB
testcase_47 AC 44 ms
81,644 KB
testcase_48 AC 146 ms
81,768 KB
testcase_49 AC 127 ms
81,584 KB
testcase_50 AC 37 ms
81,596 KB
testcase_51 AC 70 ms
81,616 KB
testcase_52 AC 161 ms
81,452 KB
testcase_53 AC 161 ms
81,400 KB
testcase_54 AC 172 ms
81,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define int long long

using namespace std;
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007,INF=1e18;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};

int n;
int dp[1000001][10];
 
signed main(){
	cin>>n;
	rep(i,0,1000001)rep(j,0,10)dp[i][j]=0;
	dp[0][0]=1;
	rep(i,0,n){
	    rep(j,0,10){
	        rep(k,j,10){
	            if(dp[i][j]>=0){
	                dp[i+1][k]+=dp[i][j];
	                dp[i+1][k]%=MOD;
	            }
	        }
	    }
	}
	int ans=0;
	rep(i,0,10){
	    ans+=dp[n][i];
	    ans%=MOD;
	    //cout<<dp[n][i];
	}
	cout<<ans<<endl;
	
	return 0;
}
0