Fixes for RISC evaluation

This commit is contained in:
elvis
2025-01-11 20:32:11 +01:00
parent 3be05222ab
commit 9bcc88e016
11 changed files with 261 additions and 115 deletions

View File

@ -1,7 +1,6 @@
def main with input n output result as
if (n % 2) == 0 then result := 1
else (
result := 0;
s := 0;
while (0 == ((n - 1) / (2 ^ s)) % 2) do (
@ -11,6 +10,7 @@ def main with input n output result as
for (i := 20, i > 0, i := i - 1) do (
a := rand(n - 4) + 2;
x := powmod(a, d, n);
y := 0;
for (j := 0, j < s, j := j+1) do (
y := powmod(x, 2, n);
if (y == 1 && (not x == 1) && (not x == n - 1)) then