DCP-254: Cube Game Back to All Problems

Beginner Math > Basic Math


Shipon is a good programmer. One day he wishes to create a computer game. In his game a player have to collect cubes by touching with a ball. There are many cubes but the color is not same for all. One cube can be colored with one of four different colors: **Blue, Silver, Gold** and **Red.** ![Cube Game Screen][1] Scoring points depend on the colors of the cubes. For each **Blue Cube** a player will get **+1** point, **Silver Cube** a player will get **+3** points, **Gold Cube** a player will get **+10** points, **Red Cube** a player will get **-5** points. This game will be played by many players one after another. Now, your work is to calculate the total score for each player and the highest score among them. Input: ------ Input starts with an integer **P (1<= P <=50)**, denoting the number of players. Next **P** lines contain Four integers **B, S, G, R (0 ≤ B, S, G, R ≤ 1000)** separated with a single space for each player. where **B** is the number of Blue Cubes, **S** is the number of Silver Cubes , **G** is the number of Gold Cubes and **R** is the number of **Red Cubes.** Output: ------- For each player print one line of output "**Player n: T**" where **n** denotes the **n** th player and **T** denotes the total score of that player. **note: when T is not positive print 0 (zero) instead of T.** Now print a single line "**High Score = H**" where **H** denotes the highest score among all players. Highest score can be **negative number.** Sample Input ------------ 3 1 2 3 4 4 5 7 1 1 1 1 1 Sample Output ------------- Player 1: 17 Player 2: 84 Player 3: 9 High Score = 84 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/e177ff0d-5af0-c3c9-a17d-08d44d1358e5_c8b4d9ebd649471488be5642f2596e7a_W501xH313.jpg


Problem Setter:

Jayed Al Hasan

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

329/1048

Solve/Submission

Ranking

# User Language Timing
01 trifiasco Cpp14 0.00s
02 Sarwar05 Cpp14 0.00s
03 I_See_You Cpp14 0.00s
04 Unseen Cpp14 0.00s
05 SleepyBrain Cpp14 0.00s
06 akazad_cse13_ruet Cpp14 0.00s
07 hrOarr Cpp14 0.00s
08 nurshuvo51 Cpp14 0.00s
09 nazmulasha Cpp14 0.00s
10 mahbubcseju Cpp14 0.00s
11 shamimjucse Cpp14 0.00s
12 seyedssz Cpp14 0.00s
13 PKP_007 Cpp14 0.00s
14 sayedgkm Cpp14 0.00s
15 liar Cpp14 0.00s
16 code_hard123 Cpp14 0.00s
17 madcoder Cpp14 0.00s
18 shahad_mahmud Cpp14 0.00s
19 pulak_ict_mbstu Cpp14 0.00s
20 as_couple Cpp14 0.00s
21 nasir_32_15 Cpp14 0.00s
22 limlim Cpp14 0.00s
23 dip_BRUR Cpp14 0.00s
24 iamsadee Cpp14 0.00s
25 Koushik_12 Cpp14 0.00s
26 tyro_ Cpp14 0.00s
27 MRoy Cpp14 0.00s
28 habib_rahman Cpp14 0.00s
29 ksohan Cpp14 0.00s
30 loop_breaker Cpp14 0.00s
31 akram Cpp14 0.00s
32 kzvd4729 Cpp14 0.00s
33 subhashis_cse Cpp14 0.00s
34 Roll_Number_27 Cpp14 0.00s
35 nuhu_iu Cpp14 0.00s
36 silentboy302 Cpp14 0.00s
37 haasib Cpp14 0.00s
38 badhansen123 Cpp14 0.00s
39 ibrahimnsu15 Cpp14 0.00s
40 shahincsejnu Cpp14 0.00s
41 aseem_cu Cpp14 0.00s
42 Santho07 Cpp14 0.00s
43 sk_roy Cpp14 0.00s
44 sadiq_nayeem Cpp14 0.00s
45 robincse14 Cpp14 0.00s
46 darkprinx Cpp14 0.00s
47 deder Cpp14 0.00s
48 joyru Cpp14 0.00s
49 Code_Hunter Cpp14 0.00s
50 susmoys Cpp14 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support