TopCoder

\begin{align} AC \times 2^9 \\ \text{New TIOJ ?} \end{align}

100.0% (3/3)

63.2% (24/38)

Input Format

#include "lib2293.h"之後實作下列函數：
void calculate_distribution(int N, double* mean, double* stdev);

int get_array(int C, int a[]);

• $1\leq N\leq 6\times 10^ 6$
• $1\leq M\leq 10^ 9$
• 一次執行中呼叫 calculate_distribution 的次數不超過 5 次。

Output Format

$f(x)=\left(s(x) \frac{(b x)^ a - b^ a}{(b x)^ a - 1.1x^ a}+\big(1-s(x)\big)\left(1-\frac{x^ 2}{2}\right)\right)$

$s(x)=\begin{cases}x, & x\in\{0,1\} \\ \frac{1}{1+\exp\left(\frac{8a}{b}\cot\left(\pi x^ {-\frac{\ln2}{0.1+\ln b}}\right)\right)}, & \text{otherwise}\end{cases}$

1
2 1 1

1.1 0.95

Problem Source

No. Testdata Range Constraints Score
1 0 $p=1,q=0.4$ 50
2 1 $p=1,q=0.4$ 50
3 2 $p=0,q=1$ 30
4 3 $p=0,q=1$ 50
5 4 $p=0,q=1$ 50
6 5 $p=0,q=1$ 110
7 6 $p=0,q=1$ 110

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 2000 1192 4 1
1 2000 1192 4 2
2 2000 1192 4 3
3 2000 1192 4 4
4 2000 1192 4 5
5 2000 1192 4 6
6 2000 1192 4 7