摘要:
#include #include #include #include #define LL long long #define LDB long double using namespace std; LDB alpha=0.75; const LL mo=3000001; int newadd; int root=1,datcnt,rbcnt,cnt,nodeintree... 阅读全文
摘要:
void buildntree(int left ,int right){ int mid=(left+right)/2; tr[++cnt].l=left;tr[cnt].r=right; if (left!=right){ int t=cnt; tr[t].lc=cnt+1; buildntree(left... 阅读全文
摘要:
procedure exgcd(a,b:int64);
var
t:longint;
begin
if b=0 then
begin
x:=1;y:=0;
exit;
end else
exgcd(b,a mod b);
t:=x;x:=y;y:=t-(a div b)*y;
end;
function cfny(a:int64):int64;
var
b:longint;
begin
b:=zs;
exgcd(a,b);
cfny:= ((x mod zs)+zs) mod zs;
end; 阅读全文