1.Assume 0.1% of the runtime of a program is not parallelizable. We are using supercomputer, which
consists of 3,120,000 cores. Under the assumption that
the program runs at the same speed on all of those cores,
and there are no additional overheads, what is the parallel
speedun on 30. 30.000 and 3.000.000 cores? B=0.001
2. The total time to execute a program is set to 1. The non-parallelizable part of the programs is 40% which out of a total time of 1 is equal to 0.4. The execution time of the program with a parallelization factor of 2 (2 threads or CPUs executing the parallelizable part) would be:
!‼️‼️‼️
var
a:array [1..100] of integer;
i,n:integer;
begin
writeln('Введите n <=100');
readln(n);
writeln('Введите массив');
for i:=1 to n do
readln(a[i]);
writeln('Массив');
for i:=1 to n do
write(a[i], ' ');
writeln;
writeln('Элементы равные сумме двух соседей:');
for i:=2 to (n-1) do
if a[i]=(a[i-1]+a[i+1]) then write(a[i],' ');
writeln;
end.
задача 5
var
a:array [1..10000] of integer;
i,n, mx1, mx2:integer;
begin
writeln('Введите n <=10000');
readln(n);
writeln('Введите массив');
for i:=1 to n do
readln(a[i]);
writeln('Массив');
for i:=1 to n do
write(a[i], ' ');
writeln;
mx1:=1;
for i:=2 to n do
if a[i]>a[mx1] then mx1:=i;
if mx1=1 then mx2:=2 else mx2:=1;
for i:=1 to n do
if (a[i]>a[mx2])and(i<>mx1) then mx2:=i;
writeln('Два числа произведение которых максимально: ',a[mx2],' ',a[mx1]);
end.