Submit | All submissions | Best solutions | Back to list |
EIUPOKEMON - Pokemon Ranking |
In My Pokemon game, each Pokemon has 4 attributes includes, attack, defense, agility, luck which are represented by four integers. All pokemons can be sorted by their power, then by their attack and their identity (which are average of four attributes). Each pokemon has an indentity which is also an integer, name and 4 attributes. The power of a pokemon is the average of 4 attributes.
Input
The first integer is the number of pokemon which denoted by n ( (0 ≤ n ≤ 105 )
Each line in the next n lines contains information about ith pokemon: identity number, name and 4 attributes, respectively.
Output
Export the ranking of Pokemon on n rows, each row includes: ordinal numbers, Pokemon codes, names
Outputt the ranking of Pokemon on n rows, each row includes: pokemon's rank, identity number, name power rounded to the unit separated by whitespaces.
Pokemons should be in order of decreasing power (not rounded), decreasing attack stats, and code increasing identity number.
If two or more Pokemon of the same rank are in the power stat then they are the same rank, and the rank of the next Pokemon is replaced by ‘-’ .
Example
Input: 4 111113 Rattata 30 40 50 20 111114 Pidgeot 50 50 50 30 111115 Spearow 30 60 42 20 111116 Arbok 40 40 40 40 Output: 1 111114 Pidgeot 45 2 111116 Arbok 40 3 111115 Spearow 38 4 111113 Rattata 35
Input: 4 111311 Bulbasaur 42 40 50 20 111312 Ivysaur 50 50 30 30 111313 Venusaur 30 60 42 20 111314 Charmander 40 40 40 40 Output: 1 111312 Ivysaur 40 - 111314 Charmander 40 3 111311 Bulbasaur 38 - 111313 Venusaur 38
Added by: | Ha Minh Ngoc |
Date: | 2019-06-20 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET |