|
Download math/math-0162.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/math/math-0162.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm/math/math-0162.jsonl
-
curl -L -o math-0162.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/math/math-0162.jsonl
1.12 kB
| {"type": "session", "harness": "opencode", "id": "math-0162", "name": "FFT and Number Theoretic Transform"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert mathematician and programmer."}} | |
| {"type": "message", "message": {"role": "user", "content": "Explain FFT for competitive programming"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "FFT: multiply two degree-n polynomials in O(n log n) instead of O(n^2).\nIdea: evaluate at n-th roots of unity (O(n log n) via divide and conquer), multiply pointwise, interpolate back.\nCooley-Tukey: split by even/odd indices, recurse.\nIterative: bit-reverse permutation, then butterfly operations.\n\nNTT: FFT mod prime. Use primitive root g of prime p (e.g., 998244353, g=3). Replace complex roots with g^k mod p.\nAdvantage: exact integer arithmetic, no floating point errors.\n\nApplications:\n- Polynomial multiplication (coefficients = product of input polynomials)\n- String matching: pattern in text via convolution\n- Subset convolution\n- Multiplying large integers\n- Counting problems: ways to sum to target"}} | |