結果
| 問題 |
No.2120 場合の数の下8桁
|
| コンテスト | |
| ユーザー |
chro_96
|
| 提出日時 | 2022-11-04 22:05:57 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 617 bytes |
| コンパイル時間 | 306 ms |
| コンパイル使用メモリ | 30,080 KB |
| 実行使用メモリ | 40,960 KB |
| 最終ジャッジ日時 | 2024-07-18 19:52:35 |
| 合計ジャッジ時間 | 2,709 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 7 RE * 2 |
ソースコード
#include <stdio.h>
int main () {
int m = 0;
int n = 0;
int res = 0;
long long ans = 1LL;
long long mul[5000000] = {};
res = scanf("%d", &m);
res = scanf("%d", &n);
if (m < n) {
printf("00000000\n");
return 0;
}
if (m-n < n) {
n = m-n;
}
for (int i = 0; i < n; i++) {
mul[i] = (long long) (m-i);
}
for (int j = n; j > 0; j--) {
int idx = m%j;
while (mul[idx]%j != 0 && idx < n) {
idx += j;
}
mul[idx] /= j;
}
for (int i = 0; i < n; i++) {
ans = (ans*mul[i])%100000000LL;
}
printf("%08lld\n", ans);
return 0;
}
chro_96