結果
| 問題 |
No.2120 場合の数の下8桁
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-04 22:48:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 526 bytes |
| コンパイル時間 | 1,527 ms |
| コンパイル使用メモリ | 167,496 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-18 20:45:11 |
| 合計ジャッジ時間 | 2,749 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
if(a>1e9) a%=1000000000;
}
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;
}