Timus Online Judge Problem 1001 - "Reverse Root"
The input stream contains a set of integer numbers \$A_i\$ (\$0 \leq A_i \leq 10^{18}\$).


So you should change

double t;


to

unsigned long long t;


This actually speeds up the program a lot.



To speed up the output, instead of

cout &lt;&lt; fixed;
cout &lt;&lt; setprecision(4);

for (int i = idx - 1; i &gt;= 0; --i)
    cout &lt;&lt; v[i] &lt;&lt; endl;


Try

for (int i = idx - 1; i &gt;= 0; --i) {
    printf("%.4f\n", v[i]);
}