結果
問題 | No.129 お年玉(2) |
ユーザー |
|
提出日時 | 2017-11-30 11:33:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 655 bytes |
コンパイル時間 | 1,473 ms |
コンパイル使用メモリ | 159,488 KB |
実行使用メモリ | 753,412 KB |
最終ジャッジ日時 | 2024-12-20 10:12:34 |
合計ジャッジ時間 | 11,658 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 MLE * 25 |
ソースコード
#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]);}