Bee
Time limit1sMemory limit128 MB
The program counts logged jobs under each of seven bee work codes and prints each count with its share of the total.
- Level
Easy2 of 10
- Topics
- Implementation, Array, Math
- Solved
- No attempts yet
Problem
The work a bee does can be classified into these seven kinds.
resting (Re), patrolling (Pt), cleaning a cell (Cc), eating pollen (Ea), tending brood (Tb), building and maintaining the comb (Cm), outside activity (Ex)
Given the record of what one bee did during one hour, write a program that reports how many times it did each kind of work and what share of the whole each kind takes.
Input
The work the bee did is given separated by spaces and newlines. The number of jobs is between 1 and 24. The record may also contain codes that are not among the seven kinds above.
Output
Print the seven kinds in the order Re, Pt, Cc, Ea, Tb, Cm, Ex, one per line. Each line holds the name of the work, how many times the bee did it, and its ratio to the total number of jobs, separated by spaces. Print a kind even when its count is 0. A code that is not among the seven kinds is not printed, but it still counts toward the total number of jobs.
Round the ratio at the third decimal place and print two decimal places. A value exactly halfway rounds up, so 0.375 prints as 0.38.
On the last line print Total <total> 1.00, where <total> is the total number of jobs the bee did.