結果

問題 No.741 AscNumber(Easy)
ユーザー asdf1asdf1
提出日時 2018-10-05 22:11:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 1,149 bytes
コンパイル時間 1,272 ms
コンパイル使用メモリ 158,700 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 17:17:30
合計ジャッジ時間 2,715 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 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 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 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 1 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 1 ms
5,376 KB
testcase_35 AC 31 ms
5,376 KB
testcase_36 AC 14 ms
5,376 KB
testcase_37 AC 16 ms
5,376 KB
testcase_38 AC 16 ms
5,376 KB
testcase_39 AC 14 ms
5,376 KB
testcase_40 AC 19 ms
5,376 KB
testcase_41 AC 27 ms
5,376 KB
testcase_42 AC 16 ms
5,376 KB
testcase_43 AC 11 ms
5,376 KB
testcase_44 AC 22 ms
5,376 KB
testcase_45 AC 24 ms
5,376 KB
testcase_46 AC 30 ms
5,376 KB
testcase_47 AC 6 ms
5,376 KB
testcase_48 AC 30 ms
5,376 KB
testcase_49 AC 25 ms
5,376 KB
testcase_50 AC 4 ms
5,376 KB
testcase_51 AC 12 ms
5,376 KB
testcase_52 AC 32 ms
5,376 KB
testcase_53 AC 33 ms
5,376 KB
testcase_54 AC 32 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;
long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum[11],pos,before[11];
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
  
       cin.tie(0);
    ios::sync_with_stdio(false);
      
      cin>>n;
      if(n==1)Cout(10);
      else if(n==2)Cout(55);
      else{
      rep(i,10)sum[i]=i+1;
      rrep(i,2,n){
        rep(i,10){
          sum[i]=sum[i-1]+sum[i];
          sum[i]%=MOD;
        }
      }
      rep(i,10){
        sum[i]%=MOD;
        ans+=sum[i]%=MOD;
        ans%=MOD;
      }
      Cout(ans);
      }
    
       
return 0;
}
0