Practice Make Perfect!

Archive for May 2010

BIG MODULUS C++

Posted by: dzikrina on: May 7, 2010

#include //#include using namespace std; typedef long long LL; LL A,B,C; LL recur(LL b){ //cout<<b<<endl; if(b==1) return A%C; LL t1 = recur(b/2); t1 = (t1*t1)%C; if(b%2==1) t1 = (t1*A)%C; return t1; } /*LL pow(LL X,int p){ LL ret = 1; for(int i=0;i<p;++i) ret=(ret*X)%C; return ret; } LL recur10(LL b){ if(b<10) return pow(A,b); LL t1 = [...]


Follow

Get every new post delivered to your Inbox.