結果

問題 No.129 お年玉(2)
ユーザー chocopuuchocopuu
提出日時 2019-01-21 23:57:56
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 866 ms / 5,000 ms
コード長 1,059 bytes
コンパイル時間 1,352 ms
コンパイル使用メモリ 167,332 KB
実行使用メモリ 394,604 KB
最終ジャッジ日時 2023-08-18 18:17:03
合計ジャッジ時間 41,962 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 781 ms
394,404 KB
testcase_01 AC 780 ms
394,388 KB
testcase_02 AC 773 ms
394,408 KB
testcase_03 AC 789 ms
394,336 KB
testcase_04 AC 776 ms
394,448 KB
testcase_05 AC 779 ms
394,308 KB
testcase_06 AC 767 ms
394,324 KB
testcase_07 AC 771 ms
394,384 KB
testcase_08 AC 772 ms
394,332 KB
testcase_09 AC 783 ms
394,332 KB
testcase_10 AC 779 ms
394,328 KB
testcase_11 AC 775 ms
394,468 KB
testcase_12 AC 776 ms
394,288 KB
testcase_13 AC 784 ms
394,336 KB
testcase_14 AC 776 ms
394,328 KB
testcase_15 AC 777 ms
394,280 KB
testcase_16 AC 773 ms
394,336 KB
testcase_17 AC 773 ms
394,276 KB
testcase_18 AC 777 ms
394,444 KB
testcase_19 AC 784 ms
394,332 KB
testcase_20 AC 787 ms
394,436 KB
testcase_21 AC 785 ms
394,404 KB
testcase_22 AC 781 ms
394,340 KB
testcase_23 AC 866 ms
394,444 KB
testcase_24 AC 769 ms
394,332 KB
testcase_25 AC 778 ms
394,360 KB
testcase_26 AC 770 ms
394,604 KB
testcase_27 AC 771 ms
394,392 KB
testcase_28 AC 769 ms
394,444 KB
testcase_29 AC 790 ms
394,324 KB
testcase_30 AC 769 ms
394,436 KB
testcase_31 AC 782 ms
394,440 KB
testcase_32 AC 774 ms
394,300 KB
testcase_33 AC 772 ms
394,348 KB
testcase_34 AC 783 ms
394,452 KB
testcase_35 AC 823 ms
394,388 KB
testcase_36 AC 784 ms
394,264 KB
testcase_37 AC 794 ms
394,348 KB
testcase_38 AC 770 ms
394,356 KB
testcase_39 AC 777 ms
394,336 KB
testcase_40 AC 776 ms
394,356 KB
testcase_41 AC 765 ms
394,360 KB
testcase_42 AC 778 ms
394,300 KB
testcase_43 AC 769 ms
394,348 KB
testcase_44 AC 796 ms
394,440 KB
testcase_45 AC 786 ms
394,356 KB
testcase_46 AC 783 ms
394,304 KB
testcase_47 AC 775 ms
394,388 KB
testcase_48 AC 789 ms
394,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint>PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;
int dx[]={0,0,1,-1};
int dy[]={-1,1,0,0};

int N,M;
int mod=1e9;
vint a[10010];

signed main(){
    cin.tie(0);
	ios::sync_with_stdio(false);
    cin>>N>>M;
    N%=1000*M;
    N/=1000;
    rep(i,0,10001){
        a[i].resize(i+2,0);
        rep(j,0,i+1){
            if(j==0)a[i][j]=1;
            else a[i][j]=(a[i-1][j]+a[i-1][j-1])%mod;
        }
    }
    cout<<a[M][N]<<endl;
































    return 0;
}
0