|
Download benchmarks/Algorithms/modular_mul/problem.md from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/modular_mul/problem.md
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/modular_mul/problem.md
-
curl -L -o problem.md https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/modular_mul/problem.md
533 Bytes
Overflow-Safe Modular Multiplication
Description
Compute the signed modular product of two integers by repeated doubling without directly multiplying them.
Input
The function receives integers $a$, $b$, and a positive modulus.
Output
Return a representative congruent to $ab$ modulo the modulus.
Constraints
- $-modulus < a < modulus$.
bfits signed Cint.- $0 < modulus$ and $2,modulus \le \texttt{INT_MAX}$.
Source
Classical modular-arithmetic problem reconstructed from the verified C artifact.