시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 22 | 18 | 14 | 82.353% |
You work for the IT department of a major league baseball team. Baseball has an almost infinite number of stats—what a great job for a computer program!
You will write a program to determine who will bat 4th in the batting order. This is called the “clean-up” position and some managers use the person with the best batting average.
You will be given the roster (with their hits and at bats). The clean-up batter will be fourth and have the highest batting average.
You will also be given a series of hits and at bats which may change the best current batting average. Here are three possibilities:
The first 9 lines consist of the current roster (last name only) and their past hits and at bats. The next 9 lines consist of the hits and at bats for the next series of games (in the same order as the roster).
Show the new roster with the highest batting average in the clean-up position.
Uecker 15 150 Ruth 50 150 Canseco 45 150 Beltre 55 150 Cruz 51 150 Kinsler 44 150 Andrus 40 150 Moreland 35 150 Darvish 10 150 0 10 5 10 0 10 0 10 9 10 5 10 5 10 5 10 1 10
Uecker Ruth Canseco Cruz Beltre Kinsler Andrus Moreland Darvish