You will have to iterate over all the elements. You can either do it with one covergroup
covergroup cg with function sample(int cp);
coverpoint cp;
endgroup;
cg cvg=new();
foreach(temp_q[i]) cvg.sample(temp_q[i]);
or an array of covergroups.
event samplecg;
covergroup cg(ref int cp) @samplecg
coverpoint cp;
endgroup;
cg cvg[N];
foreach(temp_q[i]) cvg[i] = new(temp_q[i]);