DCP-479: New online judge Back to All Problems

Easy Beginners Problems > Implementation

Two programmer from Jahangirnagar University made New online judge focussing for beginners. According to their **OJ**(online judge), they added only 10 problems with only 5 different categories. Every categories have different scores. ![enter image description here][1] Their OJ only includes following **fixed** problems. ![enter image description here][2] Their site have **N** users with their respective **Handle**. They solved some problems from this OJ. OJ is still not completed. Ranking system is missing. We know you are good programmer, Can you help her for making Ranking system? **Score of a problem** is the score of it’s category. **Score of a user** is sum of scores of problems that he/she solved. **Rank** of a user X is, (number of users whose score is greater than than X +1). Among two user with same rank, lexicographically smaller user’s handle should be on top. See sample case for more details. **Note**. String x = x1x2... x|x| is lexicographically larger than string y = y1y2... y|y|, if either |x| > |y| and x1 = y1, x2 = y2, ... , x|y| = y|y|, or exists such number r (r < |x|, r < |y|), that x1 = y1, x2 = y2, ... , xr = yr and xr + 1 > yr + 1. Characters in lines are compared like their ASCII codes. Input: ------ First line of input contains a number **N** denoting number of users. Next N lines contains, - First line contains a string(**S**), denoting user’s handle and a integer number **X**, denoting number of problem solved by S. All the user’s handles are **different**. - Next line contains **X** space separated distinct integers denoting the problem number that user S solved. **Constraint**. 1<=N<=110 User’s handle is made up of combination of 1 or more lowercase english letters (‘a’-'z'). Length of user’s handle is no more than 10. 0<=X<=10 Output: ------- Print the user’s handle from rank 1. Sample Input ------------ 4 abc 5 1 2 3 4 5 bcd 5 1 2 3 4 5 salman 2 9 10 baba 0 Sample Output ------------- salman abc bcd baba **Sample clarification.** Score of abc=1+1+3+3+5=13 Score of bcd=1+1+3+3+5=13 Score of salman=8+8=16 Score of baba=0 Score of salman is greater than all others so salman’s rank is 1. Score of abc and bcd is **same**. Both’s rank is 2, but abc should be printed first because abc is lexicographically smaller than bcd. Score of baba is zero and rank is 4. [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/d8c26433-000f-c3e6-a461-08d55cc69b71_b7d6df37d17046faae3b91d619cf018e_W703xH222.png [2]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/24b68814-8b57-c01d-aabc-08d55cc6bf28_a99e6da8830043aaa8d9c83c76b8adf0_W703xH308.png

Problem Setter:

Bir Bahadur Khatri

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats




# User Language Timing
01 tariqiitju Cpp14 0.00s
02 Pure_Protea Cpp14 0.00s
03 uzzal_rahman Cpp 0.00s
04 prodipdatta7 Cpp14 0.00s
05 sajjad_h Cpp 0.00s
06 The_Viper Cpp 0.00s
07 Md_Abid Cpp 0.00s
08 yasirnabil534 Cpp 0.00s
09 Logic_Hunter Cpp14 0.00s
10 Anubis Cpp 0.00s
11 mohibur Cpp14 0.00s
12 fayedanik Cpp 0.00s
13 sharifulalam Cpp 0.00s
14 Sarwar05 Cpp 0.00s
15 feodorv C 0.00s
16 Arif_Shariar Cpp 0.00s
17 Chayti_Saha98 Cpp 0.00s
18 notorious_94 Cpp14 0.00s
19 sbs25 Cpp 0.00s
20 The_Musketeer Cpp 0.00s
21 badhansen123 Cpp 0.00s
22 subhashis_cse Cpp 0.00s
23 siam009 Cpp 0.00s
24 DynamicOvi Cpp 0.00s
25 bondhansarker Cpp 0.00s
26 Bisnu039 Cpp 0.00s
27 milon019 Cpp 0.00s
28 tlcakash Cpp 0.00s
29 kabbya Cpp 0.00s
30 monir_18 Cpp 0.00s
31 morol Cpp14 0.00s
32 hmsayem Cpp 0.00s
33 Rasel_cse Cpp 0.00s
34 rakibulhasanmrh Cpp 0.00s
35 sparrow Cpp 0.00s
36 31_ipn Cpp 0.00s
37 MNIR Cpp 0.00s
38 MoHiUdDiN1 Cpp 0.00s
39 Abid_Hasan Cpp 0.00s
40 nafischonchol Cpp 0.00s
41 tahsin_protik Cpp 0.00s
42 MHR_MMAR Cpp 0.00s
43 sherlocked Cpp 0.00s
44 Madhab Cpp 0.00s
45 devcoder Cpp14 0.00s
46 smsaleque Cpp14 0.00s
47 Arnob114348 Cpp 0.00s
48 Ahasan_1999 Cpp 0.00s
49 Waqar_107 Cpp14 0.00s
50 Dead_Phoenix Cpp 0.00s

Your feedback is our precious!

Or call +88 02 9853138 for support