Codeforces Round #261 (Div. 2)B. Pashmak and Flowers(容易)
程序员文章站
2022-06-02 11:06:42
...
Pashmak decided to give Parmida a pair of flowers from the garden. There are n flowers in the garden and the i -th of them has a beauty number b i . Parmida is a very strange girl so she doesn't want to have the two most beautiful flowers
Pashmak decided to give Parmida a pair of flowers from the garden. There are n flowers in the garden and the i-th of them has a beauty number bi. Parmida is a very strange girl so she doesn't want to have the two most beautiful flowers necessarily. She wants to have those pairs of flowers that their beauty difference is maximal possible!
Your task is to write a program which calculates two things:
- The maximum beauty difference of flowers that Pashmak can give to Parmida.
- The number of ways that Pashmak can pick the flowers. Two ways are considered different if and only if there is at least one flower that is chosen in the first way and not chosen in the second way.
上一篇: PHP实现页面跳转
推荐阅读
-
Codeforces Round #649 (Div. 2)-B. Most socially-distanced subsequence(思维)
-
Codeforces Round #461 (Div. 2) B. Magic Forest(异或的性质)
-
Codeforces Round #663 (Div. 2) B. Fix You
-
Codeforces Round #658 (Div. 2) B. Sequential Nim
-
B. Power Sequence(数学+枚举)Codeforces Round #666 (Div. 2)
-
Codeforces Round #666 (Div. 2)B. Power Sequence(等比数列)
-
Codeforces Round #664 (Div. 2) B. Boboniu Plays Chess
-
Codeforces Round #272 (Div. 2) B. Dreamoon and WiFi (超几何
-
Codeforces Round #258 (Div. 2) B. Sort the Array (模拟)
-
Codeforces Round #657 (Div. 2) B. Dubious Cyrpto(思维,数学)