結果

問題 No.129 お年玉(2)
ユーザー naimonon77
提出日時 2015-09-19 13:35:22
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 519 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 59,164 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-19 07:54:22
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
#include <cstdio>
#include <string.h>
#include <stdlib.h>
#include <math.h>

typedef long long ll;
typedef unsigned long long ull;
typedef long double lb;

ull combi(ull n,ull r)
{
   ull i,j,k;
   ull com=1;
   for(i=0;i<r;i++) com = (com*(n-i)) % 1000000000;

   for(i=0;i<r;i++) com = (com/(r-i)) % 1000000000;
   return com;
}


int main(void)
{
   ull i,j,k;
   int memory[2];
   ull n,m;

   cin >> n >> m;

   n /= 1000;

   printf("%llu\n",combi(m,n%m));

   return 0;
}
0