这题要求的是字段而不是子序列,所以这么写:
字段
子序列
for(auto j:a) { if(lcm(val[i],j)<=5000000) b.insert(lcm(val[i],j)); }
是错误的(也许是只有我这种二才会犯的错误)。