結果

問題 No.129 お年玉(2)
ユーザー ngtkanangtkana
提出日時 2020-04-07 22:32:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 930 bytes
コンパイル時間 2,333 ms
コンパイル使用メモリ 202,448 KB
実行使用メモリ 784,748 KB
最終ジャッジ日時 2023-09-22 15:47:24
合計ジャッジ時間 22,843 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
41,740 KB
testcase_01 MLE -
testcase_02 AC 5 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 319 ms
321,388 KB
testcase_06 AC 503 ms
509,936 KB
testcase_07 MLE -
testcase_08 AC 417 ms
425,528 KB
testcase_09 MLE -
testcase_10 MLE -
testcase_11 AC 400 ms
407,984 KB
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 AC 434 ms
443,372 KB
testcase_16 AC 491 ms
504,620 KB
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 422 ms
430,108 KB
testcase_23 MLE -
testcase_24 MLE -
testcase_25 AC 401 ms
410,540 KB
testcase_26 AC 410 ms
420,724 KB
testcase_27 AC 396 ms
407,732 KB
testcase_28 MLE -
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 6 ms
7,704 KB
testcase_34 AC 3 ms
4,376 KB
testcase_35 AC 5 ms
7,060 KB
testcase_36 AC 6 ms
7,724 KB
testcase_37 AC 7 ms
9,092 KB
testcase_38 AC 83 ms
86,192 KB
testcase_39 AC 127 ms
132,440 KB
testcase_40 AC 372 ms
380,840 KB
testcase_41 AC 226 ms
230,852 KB
testcase_42 AC 95 ms
98,136 KB
testcase_43 AC 93 ms
96,196 KB
testcase_44 MLE -
testcase_45 AC 53 ms
53,968 KB
testcase_46 AC 143 ms
148,224 KB
testcase_47 MLE -
testcase_48 AC 440 ms
449,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using lubl=long double;
lint mod=1'000'000'000;
struct mint{
    lint value;
    mint()=default;
    mint(lint x):value(x){}
};
std::ostream&operator<<(std::ostream&os,mint x){return os<<x.value;}
mint operator+(mint x,mint y){lint z=x.value+y.value;if(mod<=z)z-=mod;return z;}
mint&operator+=(mint&x,mint y){return x=x+y;}
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint a,b;std::cin>>a>>b;
    a/=1'000;
    a%=b;
    std::vector<std::vector<mint>>binom(b+1,std::vector<mint>(b+1));
    binom.at(0).at(0)=1;
    for(lint i=0;i<b;i++){
        for(lint j=0;j<=i;j++){
            mint x=binom.at(i).at(j);
            binom.at(i+1).at(j)+=x;
            binom.at(i+1).at(j+1)+=x;
        }
    }
    std::cout<<binom.at(b).at(a)<<'\n';
}
0