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

14769번 - Stacking Cups 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB22217615182.514%

문제

You are programming a cup stacking module for your robot. This robot is equiped with several sensors that can accurately determine the radius and color of a cup. The problem is that there is a glitch in the robot’s core routine that processess sensor inputs so the radius is doubled, if the result of the color sensor arrives to the routine after the radius.

For instance, for a red cup with a radius of 5 units, your module will receive either “red 5” or “10 red” message.

Given a list of messages from the core routine, each describing a different cup, can you put the cups in order of the smallest to the largest?

입력

The first line of the input file contains an integer N, the number of cups (1 ≤ N ≤ 20). Next N lines will contain two tokens each, either as “color radius” or “diameter color”. The radius of a cup R will be a positive integer less than 1000. The color of a cup C will be a non-empty string of lower case English letters of length at most 20. All cups will be different in both size and color.

출력

Output colors of cups, one color per line, in order of increasing radius.

제한

예제 입력 1

3
red 10
10 blue
green 7

예제 출력 1

blue
green
red

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > 2016 Rocky Mountain Regional Contest I번

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

출처

대학교 대회

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

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