# TopCoder

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

100.0% (2/2)

100.0% (4/4)

# Input Format

#include "lib2296.h"之後實作下列函數：
void city_sequence(int N, int S, int T, int A, int B, int C, int D, int E, int F, int a0, int a1, const int m[], const int *const p[], int ans[]);

• $0\leq S<N\leq 3\times 10^ 4$
• $1\leq T\leq 5\times 10^ 6$
• $m_i\geq 1$
• $m_0+m_1+\cdots+m_{N-1}\leq 10^ 5$。
• $0\leq a_0,a_1,A,B,C,D,E,F\leq 10^ 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}$

4 0 9
1 0 0 0 0 0 1 2
3 1 3 2
1 0
2 0 0
1 0

0
2
0
3
0
3
0
3
0

# Problem Source

2020 NPSC 高中組決賽 pD / TIOJ 終極壓常數大賽 pE

No. Testdata Range Score
1 0 3
2 1 6
3 2 6
4 3 3
5 4 6
6 5 8
7 6 7
8 7 3
9 8 8
10 9 8
11 10 3
12 11 3
13 12 3
14 13 7
15 14 7
16 15 7
17 16 7
18 17 5

# Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 5000 524288 65536 1
1 5000 524288 65536 2
2 5000 524288 65536 3
3 5000 524288 65536 4
4 5000 524288 65536 5
5 5000 524288 65536 6
6 5000 524288 65536 7
7 5000 524288 65536 8
8 5000 524288 65536 9
9 5000 524288 65536 10
10 5000 524288 65536 11
11 5000 524288 65536 12
12 5000 524288 65536 13
13 5000 524288 65536 14
14 5000 524288 65536 15
15 5000 524288 65536 16
16 5000 524288 65536 17
17 5000 524288 65536 18