#include <iostream>
#include <NTL/ZZ.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
using namespace NTL;
ZZ N=to_ZZ("6");
ZZ f(ZZ x)
{
ZZ m;
m = PowerMod(x,2,N);
return m;
}
void Pollard_rho()
{
ZZ n = RandomBnd(N);
ZZ a[5];
a[0] = n;
for (int i = 1; i <= N - 1; i++)
{
a[i] = f(a[i - 1]);
for (int m = 0; m <= i; m++)
if (a[m] == a[i])
break;
}
int x, y;
for (x = 1; x <= N-1; x++)
for (y = 1; y <= N - 1; y++) {
ZZ c = a[x] - a[y];
if (GCD(c, N) != 1)
cout << c << ' ';
else break;
}
}
int main()
{
Pollard_rho();
return 0;
}
引发了未经处理的异常:读取访问权限冲突。
_ntl_ALLOC(...)
你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答
本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。
因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。