After doing this, I found that logarithm is an extremely good thing.
At first, I directly used the formula, but it was out of the floating point number range. Later I changed it to the logarithm, But it timed out. I also struggled. Later I found that I could create a table, after the table is created
# Include <stdio. h> # include <math. h> double L [100005]; int main () {int n; double k; L [0] = 0; for (double I = 1; I <= 100000; I ++) L [(int) I] = L [(int) I-1] + log2 (I); scanf ("% d", & n ); while (n --) {scanf ("% lf", & k); double t = L [(int) K-2]-2 * L [(int) k/2-1]-(K-2); printf ("%. 4f \ n ", 1-pow (2, t);} return 0 ;}# include <stdio. h> # include <math. h> double L [100005]; int main () {int n; double k; L [0] = 0; for (double I = 1; I <= 100000; I ++) L [(int) I] = L [(int) I-1] + log2 (I); scanf ("% d", & n ); while (n --) {scanf ("% lf", & k); double t = L [(int) K-2]-2 * L [(int) k/2-1]-(K-2); printf ("%. 4f \ n ", 1-pow (2, t);} return 0 ;}