I have two inputs(real and imaginary parts) for n complex numbers. I can't figure out how to store them together in a vector such that i can perform complex calculations with STL complex functions. This is something I tried but Time Limit gets exceeded.
vector<complex<double> > a;
for(i=0;i<d;i++)
{
int temp;
cin>>temp;
real.push_back(temp);
}
for(i=0;i<d;i++)
{
int temp;
cin>>temp;
imag.push_back(temp);
}
for(i=0;i<d;i++)
{
a.push_back(complex<double>(real[i], imag[i]));
}