結果
問題 | No.2120 場合の数の下8桁 |
ユーザー |
|
提出日時 | 2022-11-04 23:09:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 1,960 ms |
コンパイル使用メモリ | 167,208 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 21:02:26 |
合計ジャッジ時間 | 2,890 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 11 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define REP(i,n) for(int i=0;i<int(n);i++)typedef long long ll;typedef pair<int,int> P;int main(void){ll i,j;cin.tie(0); ios_base::sync_with_stdio(false);ll M,N;cin >> M >> N;if(M<N){cout << "00000000" << endl;return 0;}ll a=1;for(i=1;i<=N;i++){a=a*(M-i+1)/i;a%=100000000;}string s=to_string(a);ll n=s.size();if(n<=8LL){REP(i,8-n) cout << 0;cout << a << endl;}else cout << a%100000000 << endl;return 0;}