|
Download benchmarks/Algorithms/lucas_theorem/problem.md from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 734 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/lucas_theorem/problem.md
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/lucas_theorem/problem.md
-
curl -L -o problem.md https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/lucas_theorem/problem.md
734 Bytes
P3807 [Template] Lucas Theorem
题目背景
This is a template problem.
题目描述
Given integers $n, m, p$, compute $C_{n + m}^n \bmod p$.
The input guarantees that $p$ is prime.
Note: $C$ denotes the binomial coefficient.
输入格式
This problem contains multiple test cases.
The first line contains an integer $T$, the number of test cases.
For each test case:
One line with three integers $n, m, p$.
输出格式
For each test case, output one line with one integer, the required value.
输入输出样例 #1
输入 #1
2
1 2 5
2 1 5
输出 #1
3
3
说明/提示
For $100%$ of the testdata, $1 \leq n, m, p \leq 10^5$, $1 \leq T \leq 10$.
Translated by ChatGPT 5