結果

問題 No.129 お年玉(2)
ユーザー ttakanottakano
提出日時 2017-11-30 11:33:25
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 349 ms / 5,000 ms
コード長 655 bytes
コンパイル時間 2,084 ms
コンパイル使用メモリ 157,660 KB
実行使用メモリ 433,152 KB
最終ジャッジ日時 2024-05-05 16:11:35
合計ジャッジ時間 11,417 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
31,616 KB
testcase_01 AC 344 ms
433,152 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 151 ms
188,032 KB
testcase_06 AC 227 ms
288,896 KB
testcase_07 AC 277 ms
352,096 KB
testcase_08 AC 193 ms
245,792 KB
testcase_09 AC 259 ms
325,788 KB
testcase_10 AC 292 ms
364,276 KB
testcase_11 AC 192 ms
236,380 KB
testcase_12 AC 242 ms
303,636 KB
testcase_13 AC 255 ms
316,620 KB
testcase_14 AC 243 ms
306,552 KB
testcase_15 AC 202 ms
255,084 KB
testcase_16 AC 232 ms
285,952 KB
testcase_17 AC 278 ms
343,808 KB
testcase_18 AC 258 ms
324,864 KB
testcase_19 AC 280 ms
345,472 KB
testcase_20 AC 277 ms
343,040 KB
testcase_21 AC 339 ms
423,808 KB
testcase_22 AC 199 ms
246,400 KB
testcase_23 AC 297 ms
372,864 KB
testcase_24 AC 288 ms
358,784 KB
testcase_25 AC 189 ms
237,644 KB
testcase_26 AC 193 ms
242,932 KB
testcase_27 AC 193 ms
236,324 KB
testcase_28 AC 349 ms
429,556 KB
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 1 ms
6,944 KB
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 6 ms
8,832 KB
testcase_34 AC 3 ms
5,760 KB
testcase_35 AC 5 ms
8,192 KB
testcase_36 AC 5 ms
8,704 KB
testcase_37 AC 6 ms
10,112 KB
testcase_38 AC 43 ms
57,984 KB
testcase_39 AC 66 ms
84,224 KB
testcase_40 AC 180 ms
219,904 KB
testcase_41 AC 113 ms
138,752 KB
testcase_42 AC 50 ms
64,768 KB
testcase_43 AC 50 ms
63,872 KB
testcase_44 AC 343 ms
429,824 KB
testcase_45 AC 28 ms
39,040 KB
testcase_46 AC 73 ms
93,056 KB
testcase_47 AC 341 ms
416,128 KB
testcase_48 AC 214 ms
256,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define printall(n,array) for(int i=0;i<n;i++){cout<<array[i];}cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 1000000000;

ll ncr[10010][10010];

void nCr(int n){
  REP(i,n+1)REP(j,i+1){
    if(j==0)ncr[i][j]=1;
    else ncr[i][j]=(ncr[i-1][j]+ncr[i-1][j-1])%mod;
  }
}


int main(){
  ll n;
  ll m;
  cin>>n;
  cin>>m;
  ll rest=0;
  rest=(n%(1000*m));
  rest-=rest%1000;
  rest/=1000;
  nCr(m);
  print(ncr[m][rest]);
}
0