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




# User Language Timing
01 rajdipsaha Cpp14 0.00s
02 dmehrab06 Cpp14 0.00s
03 anower_per Cpp14 0.00s
04 habib_rahman Cpp14 0.00s
05 emotionless Cpp14 0.00s
06 BishalG Cpp14 0.00s
07 abid1 Cpp14 0.00s
08 anowar1112 Cpp14 0.00s
09 MRoy Cpp14 0.00s
10 rana_cse Cpp14 0.00s
11 shuvo_iu Cpp14 0.00s
12 mahbubcseju Cpp14 0.00s
13 Koushik_12 Cpp14 0.00s
14 nasir_32_15 Cpp14 0.00s
15 nuhu_iu Cpp14 0.00s
16 ksohan Cpp14 0.00s
17 SleepyBrain Cpp14 0.00s
18 nasif2587 Cpp14 0.00s
19 akazad_cse13_ruet Cpp14 0.00s
20 zitul_mahmud Cpp14 0.00s
21 I_See_You Cpp14 0.00s
22 Unseen Cpp14 0.00s
23 Anik_Nicks Cpp14 0.00s
24 Puja1409 Cpp14 0.00s
25 Gang_Of_Three_01 Cpp14 0.00s
26 PKP_007 Cpp14 0.00s
27 inactivecoder Cpp14 0.00s
28 alamin39 Cpp14 0.00s
29 Roll_Number_27 Cpp14 0.00s
30 darkprinx Cpp14 0.00s
31 sakib_ruet_13 Cpp14 0.00s
32 badhansen123 Cpp14 0.00s
33 shaft Cpp14 0.00s
34 subhashis_cse Cpp14 0.00s
35 loop_breaker Cpp14 0.00s
36 sayedgkm Cpp14 0.00s
37 sajal_khan Cpp14 0.00s
38 aseem_cu Cpp14 0.00s
39 Core_i14 Cpp14 0.00s
40 as_couple Cpp14 0.00s
41 Nazmul_WUB Cpp14 0.00s
42 asad_IT Cpp14 0.00s
43 Shakil_Mahmud Cpp14 0.00s
44 haasib Cpp14 0.00s
45 zyyxxx Cpp14 0.00s
46 udashi Cpp14 0.00s
47 tariqul2814 Cpp14 0.00s
48 FahimSifnatul Cpp14 0.00s
49 joyru Cpp14 0.00s
50 sazal_dev Cpp14 0.00s

Your feedback is our precious!

Or call +88 02 9853138 for support