Logo
(追記) (追記ここまで)

26593번 - Best Seller 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB153997365.179%

문제

You run a store and want to know where you make the most money and which items sell the most. You have a list of your items, how many times each has sold and how much profit you make each sale. Each item name is a single word. The total profit on an item is the number of sales times the profit of the item. Write a program that will take in this data and produce a sorted list using the following rules:

Sorting Rules:

  • Sort items in descending order by total profit
  • For items that have the same total profit, sort in descending order by number of sales
  • For items that have the same total profit and number of sales, sort in ascending order by name

입력

There will be an unknown number of inputs that consist of the triple itemName numberOfSales profitEachSale, with each triple on its own line, and each value on a line is separated by a single space. The itemName is a single word and the format for each input line will be:

itemName numberOfSales profitEachSale

출력

Display the sorted list, with each item on its own line. The format for displaying the item will be:

$totalProfit – itemName/numberOfSales

There is a single space before and after the dash, and the profit value must have exactly two decimal places.

제한

예제 입력 1

pens 120 .12
binders 120 1.15
hats 24 6.00
shoes 12 12.00
rings 44 22.86
coats 14 28.64
boots 12 12.00

예제 출력 1

1005ドル.84 - rings/44
400ドル.96 - coats/14
144ドル.00 - hats/24
144ドル.00 - boots/12
144ドル.00 - shoes/12
138ドル.00 - binders/120
14ドル.40 - pens/120

힌트

출처

School > PLU High School Programming Contest > PLU 2020 > Advanced 12번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /