Thứ Ba, 3 tháng 5, 2022

DEN PAS

var
n,k,i,ans,d,j:longint;
a:array[1..50000] of longint;

begin
        assign(input,'DEN.INP');reset(input);
        assign(output,'DEN.OUT');rewrite(output);
        read(n,k);
        for i:=1 to k do
        begin
            for j:=1 to n do
                if j mod (i+1)=0 then
                    a[j]:=1-a[j];
        end;
        for i:=1 to n do
            if a[i]=1 then inc(ans);
        write(ans);
end.

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.