You are viewing a single comment's thread. Return to all comments →
using namespace std;
long gcd(long x, long y) { long r; while(y!=0) { r=x%y; x=y; y=r; } return x; }
int main() { long phi,p,q, e, min=9999999,noum,ans=0; cin>>p>>q; phi=(p-1)(q-1); for(e=2;e(gcd(e-1,q-1)+1); if(noum
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #182: RSA encryption
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
include
using namespace std;
long gcd(long x, long y) { long r; while(y!=0) { r=x%y; x=y; y=r; } return x; }
int main() { long phi,p,q, e, min=9999999,noum,ans=0; cin>>p>>q;
phi=(p-1)(q-1); for(e=2;e(gcd(e-1,q-1)+1); if(noum