전처리, O(N) pre + O(1) query
팩토리얼 1..N 을 미리 계산. 이후 nCr 쿼리를 fact[n] * inv_fact[r] * inv_fact[n-r] 으로 O(1).
메타데이터
| ID | precomputation |
| 카테고리 | algorithm |
| 버전 | v4 |
| 길이 | 13.0s (13000ms) |
| 구성 | 15 elements · 5 chapters · 5 effects |
| 태그 | #precomputation #precalc #combinatorics #algorithm |
본문에 삽입
```anim:precomputation
{}
```