Vijos p1919 the most vibrant flowers, vijosp1919

Source: Internet
Author: User

Vijos p1919 the most vibrant flowers, vijosp1919

The beauty of the girl is in a smile. The quiet beauty is not allowed to be contaminated by any desire. That kind of beauty is the flowers that pursue spring in the field. It may be small, but it is the most dynamic.
The vitality of flowers will be known by counting its petals. The more petals, the more dynamic they are.
The first fall in spring, but the cold remains. M flowers are surrounded by flowers in the fields. One of the flowers has only one flower. One flower has two petals, and one flower has three petals. In this way, the last flower has m petals.
The person who loves flowers selects a random bouquet of flowers each time, and then counts the number of petals. A random bundle. A total of n random times. A bunch of flowers may be random for multiple times.
Those who love flowers should find the most dynamic bunch and send it to their beloved wooden girl.
Output a unique real number, indicating the number of petals that can be found at most n times in the expected case. The answer should be rounded to the fourth digit after the decimal point.

E = Σ mi = 1i records [in −( I −1) n] mn

Also simplified, and then supplemented =

# Include <bits/stdc ++. h> using namespace std; double qpow (double a, int p) {double ans = 1.0; for (int I = p; I >>= 1, a * = a) if (I & 1) ans = ans * a; return ans;} int main () {int m, n; while (scanf ("% d", & m, & n) = 2) {double sum = m; for (int I = 1; I <m; I ++) {sum-= qpow (double (I)/m, n);} printf ("%. 4f \ n ", sum);} return 0 ;}

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.