結果
| 問題 |
No.2120 場合の数の下8桁
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-04 23:18:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 499 bytes |
| コンパイル時間 | 1,630 ms |
| コンパイル使用メモリ | 166,928 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 21:10:49 |
| 合計ジャッジ時間 | 2,828 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 10 |
ソースコード
#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;
}
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;
}