Pagini recente » Cod sursa (job #462685) | Cod sursa (job #692280) | Cod sursa (job #1357918) | Cod sursa (job #170525) | Cod sursa (job #431155)
Cod sursa(job #431155)
program ciur;
const MAX = 1 shl 17;
var v:array[0..MAX] of longint;
n,i,j,rez:longint;
f,g:text;
begin
assign(f,'ciur.in');reset(f);
assign(g,'ciur.out');rewrite(g);
readln(f,n);
i:=3;
while (i <= N) do
begin
if (V[i shr 5] and (1 shl (i and 31)) <> 0) then
begin
i := i + 2;
continue;
end;
inc(rez);
j := i + (i shl 1);
while (j <= N) do
begin
V[j shr 5] := V[j shr 5] or (1 shl (j and 31));
j := j + (i shl 1);
end;
i := i + 2;
end;
writeln(g,rez + 1);
close(f);
close(g);
end.