1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
makvit [3.9K]
2 years ago
14

Adam is so good at playing arcade games that he will win at every game he plays. One fine day as he was walking on the street, h

e discovers an arcade store that pays real cash for every game that the player wins - however, the store will only pay out once per game. The store has some games for which they will pay winners, and each game has its own completion time and payout rate. Thrilled at the prospect of earning money for his talent, Adam walked into the store only to realize that the store closes in 2 hours (exactly 120 minutes). Knowing that he cannot play all the games in that time, he decides to pick the games that maximize his earnings
Sample game board at the arcade GAME COMPLETION TIME (in minutes) PAYOUT RATE Pac-man 90 400 Mortal Kombat 10 30 Super Tetris 25 100 Pump it Up 10 40 Street Fighter II 90 450 Speed Racer 10 40
An acceptable solution is the one where it still picks the best earnings even when the list of games or completion times or payout rates change.
Question:
Write code in Java/Scala/Python to help Adam pick the sequence(s) of games that earn him the most money?.
Then, assume you have a variable list of games and their payout rates. What is the best way to pick the games that earn you the most?
Input Explanation
The first line of input is always an integer denoting many lines to read after the first line. In our sample test case, we have 6 in the first line and 6 lines after the first line, each having a game, completion_time and payout_rate.
In each data line, the game, completion_time and payout_rate are separated by a ','(comma).
The games board may change but the store still closes in 120 minutes.
Input
6
Pac-man,80,400
Mortal Kombat,10,30
Super Tetris,25,100
Pump it Up,10,40
Street Fighter II,90,450
Speed Racer,10,40
Output Explanation
Print the game names that earn him the most into the standard output in alphabetical order
Output
Mortal Kombat
Pump it Up
Speed Racer
Street Fighter II
Computers and Technology
1 answer:
ohaa [14]2 years ago
3 0

Answer:

ask it to ur teacher boiiiiii

You might be interested in
Which statement best describes network security
Andreyy89
<span>B.network security means all personal information is kept safe the network is not compromised and only authorized users had access 

Im pretty sure they ment has instead of had</span><span />
3 0
3 years ago
Read 2 more answers
What two devices in a computer should be considered "black boxes," and should never be opened due to risks involving charged cap
NNADVOKAT [17]

The two devices in a computer that should be considered "black boxes," and should never be opened due to risks involving charged capacitors are MONITOR and POWER SUPPLY.

Explanation:

  • Physical contact or close proximity to the open power supply caused a discharge from the capacitor that resulted in an electric shock. Capacitors can discharge current even when not energized because they hold a charge for some time after the power is turned off.
  • To do harm to your body, the voltage across the capacitor's terminals must be high enough to cause a harmful effect on you. There are no hard rules for at what voltage things become harmful, but a common 'rule of thumb' is that DC up to 48 Volt is considered low voltage. So a capacitor charged to a voltage below 48 V is fairly safe.
  • A charged capacitor can be very dangerous, so it's important that you avoid coming into contact with the terminals at all times.
3 0
3 years ago
Which option ensures that different parts of the document can have different page layouts? ​
Mice21 [21]

Answer:

77777777777777777

Explanation:

8 0
3 years ago
Read 2 more answers
A state university locks in costs for a student once a student starts attending the university. The total cost is $24,500. A stu
zlopas [31]
10,700+5000+1600=17,300
24,500-17,300=7,200
7,200/10=
$720.00 will need to be saved every month.
6 0
3 years ago
Read 2 more answers
Design a 128KB direct-mapped data cache that uses a 32-bit address and 16 bytes per block. The design consists of two components
Kitty [74]

Answer:

See the attached pictures for detailed answer.

Explanation:

The cache contain 8K number of blocks.each block has 16 Byte worth of data. Each of these bytes are addressable by block offset. Now, each of these blocks are addressable and their address is provided by line offset or set offset. If block number is given in Decimal format then the block to which that block will be mapped is given by expression

mappedToBlock = (bNumber)mod2​​​13

TAG and valid but consititues something called cache controller. TAG holds the physical address information because the TAG in physical address get divided into TAG and line offset in cache address. Valid bit tells status of blocks. If it is 1 then data blocks are referred by CPI else not.

7 0
3 years ago
Other questions:
  • Suppose you want to delete an existing file from within word. What would you do?
    8·1 answer
  • The border that defines the outer boundary of a shape or other object
    13·1 answer
  • Where is authorization management app on tablet?
    7·1 answer
  • Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. The company's pr
    10·1 answer
  • How many cells does the organism have?\
    5·2 answers
  • Read the argument below and determine the underlying principle that was used to come to the conclusion presented: It is recommen
    5·1 answer
  • How do you resolve conflicts in your life??
    11·1 answer
  • List five application programs you recommend, and write a sentence explaining why.
    9·1 answer
  • Candy Kane Cosmetics (CKC) produces Leslie Perfume, which requires chemicals and labor. Two production processes are available:
    14·1 answer
  • _______ are useful when you want the user to select one choice from several possible choices. Radio buttons Check boxes Buttons
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!