foo.cc:1:26: warning: extra tokens at end of #include directive
#include <bits/stdc++.h> #define pi acos(-1) #define eps 1e-15 using namespace std; int n, m; double f[2][32005], g[2][32005]; void solve1(){ int p = 0, q = 1; f[p][0] = 1; g[p][0] = 1; for(int i = 1; i <= n; i ++){ for(int j = 0; j <= (m - 1) * i; j ++){ double tmp = g[p][min(j, (m - 1) * (i - 1))]; if(j >= m) tmp -= g[p][j - m]; f[q][j] = tmp / m; g[q][j] = f[q][j]; if(j > 0) g[q][j] += g[q][j - 1]; // printf("%d %d %.6lf\n", i, j, f[q][j]); } swap(p, q); } for(int i = 1; i <= 10; i ++){ int a, b; scanf("%d%d", &a, &b); double ans = g[p][b]; if(a != 0) ans -= g[p][a - 1]; printf("%.6lf\n", ans); } } double mu, sigma, pi2; inline double sqr(double x) {return x * x;} inline double F(double x){ // printf("%.10lf %.10lf\n", x, exp(-sqr(x - mu) / 2 / sqr(sigma)) / pi2 / sigma); return exp(-sqr(x - mu) / 2 / sqr(sigma)) / pi2 / sigma; } double cal(double l, double r){ double mid = (l + r) / 2; return (r - l) / 6 * (F(l) + 4 * F(mid) + F(r)); } double simpson(double l, double r, double cur){ double mid = (l + r) / 2; double cl = cal(l, mid); double cr = cal(mid, r); // printf("%.11lf %.11lf %.11lf %.11lf %.11lf %.11lf\n", l, r, cl, cr, cur, fabs(cur - cl - cr)); if(fabs(cur - cl - cr) < eps) return cur; return simpson(l, mid, cl) + simpson(mid, r, cr); } void solve2(){ mu = 1.0 * (m - 1) / 2.0 * n; sigma = sqrt(n * 1.0 * (m * m - 1.0) / 12.0); //printf("%.6lf %.6lf\n", mu, sigma); pi2 = sqrt(2.0 * pi); for(int i = 1; i <= 10; i ++){ int a, b; scanf("%d%d", &a, &b); double l = max((double)a, mu - 3 * sigma); double r = min((double)b, mu + 3 * sigma); double ans = 0; if(l < r) ans = simpson(l, r, cal(l, r)); printf("%.6lf\n", ans); } } int main(){ int T; scanf("%d", &T); while(T--){ scanf("%d%d", &m, &n); if(n <= 1600){ solve1(); }else{ solve2(); } } return 0; }
^
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
[Hydro](https://hydro.ac)提供评测服务