結果
| 問題 | No.741 AscNumber(Easy) | 
| コンテスト | |
| ユーザー |  tetsuzuki1115 | 
| 提出日時 | 2018-10-07 17:36:21 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 302 ms / 2,000 ms | 
| コード長 | 677 bytes | 
| コンパイル時間 | 784 ms | 
| コンパイル使用メモリ | 92,476 KB | 
| 実行使用メモリ | 128,640 KB | 
| 最終ジャッジ日時 | 2024-10-12 14:15:28 | 
| 合計ジャッジ時間 | 6,124 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 55 | 
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;
long long MOD = 1000000007;
long long A[1000000+10][10] = {0};
long long func( long long n, long long r ) {
    if ( A[n][r] ) { return A[n][r]; }
    if ( n/2 < r ) { r = n-r; }
    if ( r == 0 ) { return 1; }
    A[n][r] = ( func(n-1,r)+func(n-1,r-1) )%MOD;
    return A[n][r];
}
int main() {
    
    long long N;
    cin >> N;
    cout << func( N+9, 9 ) << endl;
    return 0;
}
            
            
            
        