CF523B.Mean Requests
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The first line contains integer n ( 1<=n<=2⋅105 ), integer T ( 1<=T<=n ) and real number c ( 1<c<=100 ) — the time range when the resource should work, the length of the time range during which we need the mean number of requests and the coefficient c of the work of approximate algorithm. Number c is given with exactly six digits after the decimal point.
The next line contains n integers at ( 1<=at<=106 ) — the number of queries to the service at each moment of time.
The next line contains integer m ( 1<=m<=n ) — the number of moments of time when we are interested in the mean number of queries for the last T seconds.
The next line contains m integers pj ( T<=pj<=n ), representing another moment of time for which we need statistics. Moments pj are strictly increasing.
输入格式
Print m lines. The j -th line must contain three numbers real , approx and error , where:
is the real mean number of queries for the last T seconds;- approx is calculated by the given algorithm and equals mean at the moment of time t=pj (that is, after implementing the pj -th iteration of the cycle);
is the relative error of the approximate algorithm.
The numbers you printed will be compared to the correct numbers with the relative or absolute error 10−4 . It is recommended to print the numbers with at least five digits after the decimal point.
输出格式
无
输入输出样例
输入#1
1 1 2.000000 1 1 1
输出#1
1.000000 0.500000 0.500000
输入#2
11 4 1.250000 9 11 7 5 15 6 6 6 6 6 6 8 4 5 6 7 8 9 10 11
输出#2
8.000000 4.449600 0.443800 9.500000 6.559680 0.309507 8.250000 6.447744 0.218455 8.000000 6.358195 0.205226 8.250000 6.286556 0.237993 6.000000 6.229245 0.038207 6.000000 6.183396 0.030566 6.000000 6.146717 0.024453
输入#3
13 4 1.250000 3 3 3 3 3 20 3 3 3 3 3 3 3 10 4 5 6 7 8 9 10 11 12 13
输出#3
3.000000 1.771200 0.409600 3.000000 2.016960 0.327680 7.250000 5.613568 0.225715 7.250000 5.090854 0.297813 7.250000 4.672684 0.355492 7.250000 4.338147 0.401635 3.000000 4.070517 0.356839 3.000000 3.856414 0.285471 3.000000 3.685131 0.228377 3.000000 3.548105 0.182702
输入解题思路,AI测评打分。不知道怎么写?