HBC209990DPS题解

不可一世的小女人 算法基础篇 44 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
There are n players in the game. Given that the i-th player dealt. Instead of formal definition of bar description, we will give an example. For some player i whose. Moreover, you have to mark the player with maximal damage dealt to enemies by replacing the last space into '*'. If there're multiple maximum, mark all of them.

When you are playing multiplayer games, you may want to show that you are the MVP of your team -- or blame the one always wandering and watching away from the storm center. Well, there're statistics that show you preformance, but sometimes numbers speak softer than charts. Now, you're hired to write a program that output ASCII art histograms showing damage dealt to enemies. There are n players in the game. Given that the i-th player dealt  d_i d i ​ damage to enemies where  max_i d_i > 0 max i ​ d i ​ >0 is granted, you need to calculate the number  s_i s i ​ of spaces in the bar by the following foluma: s_i = lceil 50 frac {d_i} {max_i d_i} rceil s i ​ =⌈50 max i ​ d i ​ d i ​ ​ ⌉ Instead of formal definition of bar description, we will give an example. For some player i whose  s_i = 7 s i ​ =7 and d_i = 777 d i ​ =777, the bar is shown as: +-------+ |       |777 +-------+ Moreover, you have to mark the player with maximal damage dealt to enemies by replacing the last space into '*'. If there're multiple maximum, mark all of them. See samples for more ideas.

HBC209990DPS题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC209990DPS题解