結果

問題 No.129 お年玉(2)
ユーザー ama_nukoama_nuko
提出日時 2018-06-15 17:48:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 634 bytes
コンパイル時間 1,538 ms
コンパイル使用メモリ 95,020 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-30 14:52:00
合計ジャッジ時間 3,376 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    int n, m;
    cin >> n >> m;
    n /= 1000;
    n %= m;

    vector<int> dp(m+1);
    dp[0] = 1;
    dp[1] = 1;
    for(int i = 1; i < m; i++){
        for(int j = i; j >= 0; j--){
            dp[j+1] += dp[j];
        }
    }
    cout << dp[n] % 1000000000 << endl;

    return 0;
}
0