摘要:
procedure euler;
var
i,j:longint;
begin
phi[1]:=1;
for i:=2 to n do
begin
if not mark[i] then
begin
inc(tot);
p[tot]:=i;
phi[i]:=i-1;
end;
for j:=1 to n do
begin
if i*p[j]>n then break;
mark[i*p[j]]:=true;
if i mod p[j]=0 then
begin
phi[i*p[j]]:=phi[i]*p[j];
break; 阅读全文
摘要:
先上我原来的错误的代码 type node=^link; link=record num:int64; next:node; end; var fa:array[0..300000,0..100] of int64; dep:array[0..300000] of int64; nd:array[0 阅读全文
摘要:
type jd=record z,y,lc,rc,sum,toadd:int64; end; var tree:array[0..800000] of jd; qzh:array[0..200000] of int64; x:array[1..200000] of int64; n,m,a,b,k, 阅读全文