高兴的小明
高兴的小明 |
难度级别:A; 运行时间限制:1000ms; 运行空间限制:51200KB; 代码长度限制:2000000B |
试题描述
|
输入
|
输出
|
输入示例
|
3
1 2 3 4 |
输出示例
|
7
|
其他说明
|
提交网址: http://marcool.net/home/problem.htm?problemID=5
var a:array[0..10000]of longint;
b:array[1..100]of longint;
i,j,x,n,m:longint;
begin
readln(n);
for i:= 1 to n do read(b[i]);
readln(m);
for i:= 1 to n do
for j:= 0 to m-1 do
a[j*b[i]]:=1;
ans:=0;
for i:= 0 to 10000 do
if a[i]=1 then inc(x);
writeln(x);
end.
b:array[1..100]of longint;
i,j,x,n,m:longint;
begin
readln(n);
for i:= 1 to n do read(b[i]);
readln(m);
for i:= 1 to n do
for j:= 0 to m-1 do
a[j*b[i]]:=1;
ans:=0;
for i:= 0 to 10000 do
if a[i]=1 then inc(x);
writeln(x);
end.