比赛 2022级数学专题练习赛6 评测结果 AAATTTTTTT
题目名称 最终得分 30
用户昵称 yrtiop 运行时间 21.000 s
代码语言 C++ 内存使用 5.08 MiB
提交时间 2023-01-23 19:37:57
显示代码纯文本
#include <bits/stdc++.h>
#define pb emplace_back
#define fir first
#define sec second
using i64 = long long;
using u64 = unsigned long long;
using pii = std::pair<int,int>;

const int maxn = 1e5 + 5;
const i64 mod = 998244353;
double a[maxn],f[maxn];
int n;

int main() {
	freopen("force.in","r",stdin);
	freopen("force.out","w",stdout);
	scanf("%d",&n);
	for(int i = 1;i <= n;++ i)
		scanf("%lf",&a[i]);
	for(int i = 1;i <= n;++ i) {
		for(int j = 1;j < i;++ j) {
			f[i] += a[j] / (double)(1.0 * (double)(i - j) * (double)(i - j));
		}
		for(int j = i + 1;j <= n;++ j) {
			f[i] -= a[j] / (double)(1.0 * (double)(j - i) * (double)(j - i));
		}
		printf("%.4lf\n",f[i]);
	}
	return 0;
}