bzoj1011题解
【解题思路】
这题解法很多,我也不知道标算是什么。。
这简直就是大放水啊。。
网上流传的乱搞法,对于小范围内(假设为[1,l]∩N)暴力,大范围内估算。
我写这题时还是写P的?!。。但是我看不懂我当时写了什么,也忘了当时看的哪篇博客。。
贴个代码跑。。理论复杂度O(nl+n2a(1-a)),然后A了?!

不知bzoj数据有没有加强。。
【参考代码】
const
ladder=;
var
n,i,j,k:longint;
limit:extended;
m,g:array [..] of longint;
f:array [..] of extended;
begin
read(n,limit);
for i:= to n do
begin
read(m[i]);
g[i]:=trunc(i*limit);
end;
fillchar(f,sizeof(f),);
for i:= to n do
if g[i]> then
if i<=ladder then
begin
for j:= to g[i] do f[i]:=f[i]+m[j]/(i-j);
f[i]:=f[i]*m[i];
end
else
begin
k:=i-ladder;
f[i]:=f[k]/m[k]*(k-g[k]/)/(i-g[k]/);
for j:=g[k]+ to g[i] do f[i]:=f[i]+m[j]/(i-j);
f[i]:=f[i]*m[i];
end;
for i:= to n do writeln(f[i]::);
end.
bzoj1011题解的更多相关文章
- 【BZOJ1011】【HNOI2008】遥远的行星 误差分析
题目大意 给你\(n,b\),还有一个数列\(a\). 对于每个\(i\)求\(f_i=\sum_{j=1}^{bi}\frac{a_ja_i}{i-j}\). 绝对误差不超过\(5\%\)就算对. ...
- bzoj1011 遥远的行星
bzoj1011 遥远的行星 原题链接 题解 一道真正的玄学题.... 其实这题根本没法做 首先暴力这么跑:\[ans(s)=\sum_{i=1}^{\lfloor As\rfloor}\frac{M ...
- 2016 华南师大ACM校赛 SCNUCPC 非官方题解
我要举报本次校赛出题人的消极出题!!! 官方题解请戳:http://3.scnuacm2015.sinaapp.com/?p=89(其实就是一堆代码没有题解) A. 树链剖分数据结构板题 题目大意:我 ...
- noip2016十连测题解
以下代码为了阅读方便,省去以下头文件: #include <iostream> #include <stdio.h> #include <math.h> #incl ...
- BZOJ-2561-最小生成树 题解(最小割)
2561: 最小生成树(题解) Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 1628 Solved: 786 传送门:http://www.lyd ...
- Codeforces Round #353 (Div. 2) ABCDE 题解 python
Problems # Name A Infinite Sequence standard input/output 1 s, 256 MB x3509 B Restoring P ...
- 哈尔滨理工大学ACM全国邀请赛(网络同步赛)题解
题目链接 提交连接:http://acm-software.hrbust.edu.cn/problemset.php?page=5 1470-1482 只做出来四道比较水的题目,还需要加强中等题的训练 ...
- 2016ACM青岛区域赛题解
A.Relic Discovery_hdu5982 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Jav ...
- poj1399 hoj1037 Direct Visibility 题解 (宽搜)
http://poj.org/problem?id=1399 http://acm.hit.edu.cn/hoj/problem/view?id=1037 题意: 在一个最多200*200的minec ...
随机推荐
- Tomcat启动后中文乱码,怎么解决这个问题
今天很疑惑这个问题,于是去网上找了答案,结果是需要修改Tomcat根目录下面的"logging.properties"文件,把所有的encoding=UTF-8的改成encodng ...
- org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplic
org.springframework.context.ApplicationContextException: Unable to start web server; nested exceptio ...
- 路由网关--spring cloud zuul
路由网关--spring boot Zuul 1.为什么需要Zuul? Zuul Ribbon 以及 Eureka 相结合,可以实现智能路由和负载均衡的功能, Zuul 能够将请求流量按某种策略分发到 ...
- vue 非父子组件之间的传值(Bus/总线/发布订阅模式/观察者模式)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 线程池——Executors
一 Executor框架 为了更好地控制多线程,JDK提供了一套线程框架Executor,帮助开发人员有效的进行线程控制.它们都在java.util.concurrent包中,是JDK并发包的核心.其 ...
- 【leetcode】969. Pancake Sorting
题目如下: Given an array A, we can perform a pancake flip: We choose some positive integer k <= A.len ...
- 第十一次 LL(1)文法的判断,递归下降分析程序
1. 文法 G(S): (1)S -> AB (2)A ->Da|ε (3)B -> cC (4)C -> aADC |ε (5)D -> b|ε 验证文法 G(S)是不 ...
- c#开发应避免的几个小滥用
一 String和StringBuilder 少量的字符串操作不宜采用StringBuilder. 由于string是不可变得对象,对于string的叠加,每次操作 ...
- Attribute 实现Aop
1.先定义一个 拦截属性 AopAttribute using System; using System.Collections.Generic; using System.Linq; using S ...
- ueditor不能上传mp4格式的视频--解决方案
1.ueditor.all.js 去掉所有的 type="application/x-shockwave-flash" 2.ueditor.all.min.js 去掉所有的 typ ...