eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків

uHunt

For those who don't know, \href{http://uhunt.felix-halim.net/id/32900}{uHunt} stands for "UVa Hunting", a tool for \href{http://uva.onlinejudge.org/}{UVa online-judge} that keeps track which problems you have solved and provides statistics as well as a number of selections for the next problem to solve. This website is created by my brother Felix Halim. Considering that so far, UVa online-judge has about \textbf{9} million submissions (approximately one submission per few seconds), about \textbf{3000} different programming problems, and about \textbf{120000} different users (probably only thousands are currently active), my brother has to highly optimize this tool so that all its features runs "in an instant". In this problem, we will concentrate on a small subset of uHunt feature, the "instant re-ranking of accepted submissions". One parameter that is ranked in UVa online judge is the accepted submission's runtime speed on judge's data and judge's machine. Suppose we are dealing with problem_id "\textbf{100}". Previously there were \textbf{4} accepted submissions for this problem with the following rankings in this format: (rank, user_name, runtime_speed_in_seconds): \textbf{1. josh 0.120 2. nhahtdh 0.127 3. felix 0.223 4. steven 0.323} Now if user "\textbf{you}" submits an accepted code for problem_id "\textbf{100}" and this code is judged to have a runtime of \textbf{0.127s}, then "\textbf{you}" will be placed as the new rank \textbf{3} with "\textbf{felix}" and "\textbf{steven}" demoted to rank \textbf{4} and \textbf{5}, respectively. Note that although "\textbf{you}" ties with "\textbf{nhahtdh}", "\textbf{you}" will be ranked after "\textbf{nhahtdh}", who submitted his accepted code earlier. \textbf{1. josh 0.120 2. nhahtdh 0.127 3. you 0.127 4. felix 0.223 5. steven 0.323} Suppose user "\textbf{you}" is not happy to get rank 3 and choose to improve his accepted code for problem_id "\textbf{100}". Upon resubmission, his new code (that contains more implementation hack) is judged to have a runtime of \textbf{0.115s}, then "\textbf{you}" will be placed as the new rank \textbf{1} with "\textbf{josh}" and "\textbf{nhahtdh}" demoted to rank \textbf{2} and \textbf{3}, respectively. Notice that "\textbf{felix}" and "\textbf{steven}" stays at rank \textbf{4} and \textbf{5}, respectively. \textbf{1. you 0.115 2. josh 0.120 3. nhahtdh 0.127 4. felix 0.223 5. steven 0.323} If another user "\textbf{grace}" submits an accepted code for problem_id "\textbf{100}" with runtime \textbf{3.475s}, Then the new ranking will be: \textbf{1. you 0.115 2. josh 0.120 3. nhahtdh 0.127 4. felix 0.223 5. steven 0.323 6. grace 3.475} Suppose after further tinkering with his program, user "\textbf{you}" submits another accepted code for problem_id "\textbf{100}" with runtime \textbf{0.121s}. Since this is actually slower than his previous best, UVa online judge (and uHunt) "\textbf{ignores}" this submission. The ranking stays at: \textbf{1. you 0.115 2. josh 0.120 3. nhahtdh 0.127 4. felix 0.223 5. steven 0.323 6. grace 3.475} \InputFile The first line of input is \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{50000}), the number of submissions sorted by submission time. You have to process these submissions one after another. Then, there will be \textbf{n} lines of three numbers: \textbf{problem_id}, \textbf{user_id}, and \textbf{t}. \textbf{problem_id} is a \textbf{3} digits integer of problem numbers within range \textbf{\[100-199\]}. \textbf{user_id} is a \textbf{4} digits integer of coder identification id within range \textbf{\[0000-9999\]}. \textbf{t} is a real number with at most \textbf{3} digits after decimal points. You can be sure that \textbf{t} will not be larger than \textbf{9.999} (as the time limit for all problems is < \textbf{10} seconds). This \textbf{t} is the runtime of accepted codes of user \textbf{user_id} for problem \textbf{problem_id}. \OutputFile For each line of input, immediately output five numbers separated by a single space: \textbf{problem_id}, \textbf{user_id}, and \textbf{t} - these three are the same as input, then followed by: \textbf{best_t_for_this_problem_id}, and finally: \textbf{rank_of_user_id_for_this_problem_id} \textbf{best_t_for_this_problem_id} is defined as the runtime of the accepted code submitted by the best coder (who is currently rank \textbf{1}) for this particular problem. r\textbf{ank_of_user_id_for_this_problem_id} is defined as the ranking of the current coder for this particular problem as described in the problem description above. However, if that submission from a certain user is actually slower than or equal to his previous best, Then output: "\textbf{submission ignored}" (without the quotes), in one line instead.
Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
12
100 0000 0.120
100 0001 0.323
100 0002 0.223
101 0000 9.999
100 0003 0.127
100 0004 0.127
101 0001 9.998
199 0000 7.777
100 0004 0.115
100 0005 3.475
100 0004 0.121
101 0001 9.998
Вихідні дані #1
100 0000 0.120 0.120 1
100 0001 0.323 0.120 2
100 0002 0.223 0.120 2
101 0000 9.999 9.999 1
100 0003 0.127 0.120 2
100 0004 0.127 0.120 3
101 0001 9.998 9.998 1
199 0000 7.777 7.777 1
100 0004 0.115 0.115 1
100 0005 3.475 0.115 6
submission ignored
submission ignored