|
Download benchmarks/Algorithms/modular_power/problem.md from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 508 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/modular_power/problem.md
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/modular_power/problem.md
-
curl -L -o problem.md https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/modular_power/problem.md
508 Bytes
| # P1226 — Fast Modular Exponentiation | |
| ## Description | |
| Given three integers $a$, $b$, and $p$, compute | |
| $$ | |
| a^b \bmod p. | |
| $$ | |
| ## Input | |
| The only line contains three integers $a$, $b$, and $p$. | |
| ## Output | |
| Print one line in the following format: | |
| ```text | |
| a^b mod p=s | |
| ``` | |
| Here `a`, `b`, and `p` are the input values, and $s=a^b\bmod p$. | |
| ## Constraints | |
| - $0 \le a,b < 2^{31}$. | |
| - $a+b>0$. | |
| - $2 \le p < 2^{31}$. | |
| ## Source | |
| [Luogu P1226, "Fast Modular Exponentiation"](https://www.luogu.com.cn/problem/P1226). | |