結果

問題 No.741 AscNumber(Easy)
ユーザー Taiki0715Taiki0715
提出日時 2023-04-25 17:23:19
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 1,459 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 148,992 KB
実行使用メモリ 73,472 KB
最終ジャッジ日時 2024-04-26 22:00:49
合計ジャッジ時間 5,343 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,248 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 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 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 1 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 2 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 1 ms
5,376 KB
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 117 ms
70,272 KB
testcase_36 AC 52 ms
32,384 KB
testcase_37 AC 61 ms
37,632 KB
testcase_38 AC 59 ms
37,120 KB
testcase_39 AC 51 ms
31,744 KB
testcase_40 AC 68 ms
42,112 KB
testcase_41 AC 107 ms
64,256 KB
testcase_42 AC 59 ms
35,456 KB
testcase_43 AC 43 ms
26,624 KB
testcase_44 AC 83 ms
50,944 KB
testcase_45 AC 90 ms
54,784 KB
testcase_46 AC 110 ms
66,816 KB
testcase_47 AC 20 ms
13,824 KB
testcase_48 AC 110 ms
66,816 KB
testcase_49 AC 94 ms
56,320 KB
testcase_50 AC 14 ms
10,240 KB
testcase_51 AC 44 ms
27,776 KB
testcase_52 AC 123 ms
73,472 KB
testcase_53 AC 122 ms
73,344 KB
testcase_54 AC 121 ms
72,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <math.h>
#include <cassert>
#include <bitset>
#include <map>
#include <algorithm>
#include <iterator>
#include <string>
#include <utility>
#include <numeric>
#include <regex>
#include <complex>
#include <atcoder/modint>
using namespace atcoder;
using namespace std;
using ll=long long;
using ull=unsigned long long;
using P=pair<ll,ll>;
template<typename T>using minque=priority_queue<T,vector<T>,greater<T>>;
template<typename T>bool chmax(T &a,const T &b){return (a<b?(a=b,true):false);}
template<typename T>bool chmin(T &a,const T &b){return (a>b?(a=b,true):false);}
template<typename T1,typename T2>
ostream &operator<<(ostream &os,const pair<T1,T2>&p){
  os<<p.first<<" "<<p.second;
  return os;
}
template<typename T1,typename T2>
istream &operator>>(istream &is,pair<T1,T2>&p){
  is>>p.first>>p.second;
  return is;
}
template<typename T>
istream &operator>>(istream &is,vector<T> &a){
  for(auto &i:a)is>>i;
  return is;
}
#define reps(i,a,n) for(int i=(a);i<(n);i++)
#define rep(i,n) reps(i,0,n)
#define all(x) x.begin(),x.end()
ll myceil(ll a,ll b){return (a+b-1)/b;}
using mint=modint1000000007;
int main(){
  int n;
  cin>>n;
  vector<vector<mint>>dp(n+1,vector<mint>(10,0));
  dp[0][0]=1;
  rep(i,n){
    rep(j,10){
      reps(k,j,10){
        dp[i+1][k]+=dp[i][j];
      }
    }
  }
  mint ans=0;
  rep(i,10)ans+=dp[n][i];
  cout<<ans.val()<<endl;
}
0