#9022: 只能说这题太难了


lsweizixuan (······)

School : 上海市娄山中学
ID : 41716
IP address : [130.88.197.112]
Last Login :
2020-01-31 00:14:49
d838. NOIP2003 4.麦森数 -- NOIP2003普及组第四题 | From: [115.231.174.135] | Post Date : 2014-07-22 16:20

var
p,ls,i,j,k1,k2:longint;
s:array[1..500] of byte;
begin
readln(p);
writeln(trunc(p*ln(2)/ln(10))+1);
s[1]:=1;
ls:=0;
for i:=1 to p do begin
ls:=ls+1;
if ls>500 then ls:=500;
k1:=0;
for j:=1 to ls do begin
k2:=s[j]*2+k1;
k1:=k2 div 10;
s[j]:=k2 mod 10;
end;
end;
s[1]:=s[1]-1;
for i:=500 downto 1 do begin
write(s[i]);
if (i-1) mod 50=0 then writeln;
end;
readln;
end.
 
ZeroJudge Forum