Submit | All submissions | Best solutions | Back to list |
DOTAA2 - HELP NERUBAN |
Neruban, the DotA gamer knows to play with some heroes. You are given the list of heroes that Neruban knows to play with. You are also given how accurate he can play, how fast he can play and how stupidly he can play with every hero. i.e. for each hero you are given 3 values Accuracy (a), Speed (v) and Stupidity (s). Neruban wants to rank the heroes according to the order with which he can play perfectly. So sort the heroes based on higher accuracy, higher speed and lower stupidity.
For example a hero with a = 10, v = 1, s = 100 is higher ranked than a hero with a = 1, v = 100, s = 0, because first preference is given for the accuracy of the hero.
Similarly a hero with a = 10, v = 5, s = 20 is higher ranked than a hero with a = 10, v = 4, s = 40, because second preference is given for the speed of the hero.
A hero with a = 10, v = 3, s = 10 is higher ranked than a hero with a = 10, v = 3, s = 15, because stupidity of a player should be lower
If any two heroes have same accuracy, speed and stupidity, sort them based on their name alphabetically.
Input
The first line consists of an integer n, the number of heroes. The next n lines describe each hero with 4 values - the name of the hero, accuracy, speed and stupidity.
Output
Sort the heroes based on the above criteria and print the rank list.
Constraints
1 <= n <= 100000
Name of a hero <= 15 characters (all lower case)
0 <= a, v, s <= 100
Example
Input: 4 goblinshredder 45 66 98 pudge 45 86 76 shadowfiend 99 98 2 invoker 45 86 75 Output: shadowfiend invoker pudge goblinshredder
Added by: | cegprakash |
Date: | 2012-10-12 |
Time limit: | 1.364s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ADA95 ASM32 GAWK C CSHARP C++ 4.3.2 CPP14-CLANG C99 CLPS CLOJURE LISP sbcl LISP clisp D-CLANG ERL FSHARP FORTRAN GO HASK ICON ICK JS-RHINO JS-MONKEY LUA NICE NIM NODEJS OCAML PAS-FPC PERL PERL6 PHP PICO PIKE PRLG-swi PYTHON PYPY PYTHON3 RUBY SCM guile SCM qobi SED TCL VB.NET WHITESPACE |
Public source code since: | 4012-10-16 21:00:00 |
hide comments
2013-02-27 15:24:28 Sanjay
what is d syntax for declaring header file in C++(g++ 4.0.0-8 |
|
2013-02-24 21:06:05 Ebraheem AlKilanny
http://ideone.com/hFCDQC why gives wa? |