Bzoj 1011 Distant Planets

Source: Internet
Author: User

Error DP (what ghost)

Read the question (the error does not exceed%5 is also counted) This sentence is really no egg use, but this is the key to solve the problem, because the two distant planets to the answer is very small contribution,

So we can make part of the unification divided by a length, in order to ensure the accuracy of the requirements, the previous part of the violent calculation, so it can be over

1 #defineMAXN 100010UL2#include <cmath>3#include <cstdio>4#include <algorithm>5 #defineEPS 1e-76 7 using namespacestd;8 9typedefLong Longll;Ten  One intN; A ll SUM[MAXN], M[MAXN]; - DoubleA, F[MAXN]; -  the intMain () { -scanf"%D%LF", &n, &A); -      for(inti =1; I <= N; + + i) scanf ("%lld", &m[i]), sum[i] = m[i]+sum[i-1]; -      for(inti =1, r = min ( -, n); I <= R; ++i) { +         intK = (int) (i*A); -         if(Fabs (k +1)/a-i) (<eps) + +K; +          for(intj =1; J <= K; + + j) F[i] + = m[i]*m[j]/(Double) (I-j); A     } at      for(inti =2001; I <= N; ++i) { -         intK = (int) (i*a), Mid = (1+K) >>1; -F[i] = sum[k]*m[i]/(Double) (I-mid); -     } -      for(inti =1; I <= N; + + i) printf ("%lf\n", F[i]); -     return 0; in}
View Code

Bzoj 1011 Distant Planets

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.