結果

問題 No.129 お年玉(2)
ユーザー ttakanottakano
提出日時 2017-11-30 11:33:25
言語 C++11
(gcc 11.4.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 655 bytes
コンパイル時間 1,696 ms
コンパイル使用メモリ 144,128 KB
実行使用メモリ 766,000 KB
最終ジャッジ日時 2023-08-18 10:44:12
合計ジャッジ時間 11,509 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
103,060 KB
testcase_01 AC 537 ms
507,812 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 167 ms
261,104 KB
testcase_06 AC 256 ms
407,012 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 MLE -
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
5,440 KB
testcase_32 AC 2 ms
5,736 KB
testcase_33 AC 14 ms
62,968 KB
testcase_34 AC 9 ms
36,188 KB
testcase_35 AC 13 ms
58,792 KB
testcase_36 AC 14 ms
62,888 KB
testcase_37 AC 16 ms
71,000 KB
testcase_38 AC 60 ms
257,528 KB
testcase_39 AC 77 ms
320,860 KB
testcase_40 MLE -
testcase_41 AC 107 ms
425,364 KB
testcase_42 AC 64 ms
275,824 KB
testcase_43 AC 64 ms
271,712 KB
testcase_44 MLE -
testcase_45 AC 46 ms
202,104 KB
testcase_46 AC 82 ms
339,320 KB
testcase_47 MLE -
testcase_48 MLE -
権限があれば一括ダウンロードができます

ソースコード

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