Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
1431
|
Kotlin Heroes 5: ICPC Round |
FINISHED |
False |
9000 |
132161111 |
Nov. 12, 2020, 2:35 p.m. |
Problems
B'There are n customers in the cafeteria. Each of them wants to buy a hamburger. The i -th customer has a_i coins, and they will buy a hamburger if it costs at most a_i coins. Suppose the cost of the hamburger is m . Then the number of coins the cafeteria earns is m multiplied by the number of people who buy a hamburger if it costs m . Your task is to calculate the maximum number of coins the cafeteria can earn. The first line contains one integer t ( 1 <= t <= 100 ) -- the number of test cases. Each test case consists of two lines. The first line contains one integer n ( 1 <= n <= 100 ) -- the number of customers. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^{12} ), where a_i is the number of coins the i -th customer has. For each test case, print one integer -- the maximum number of coins the cafeteria can earn. Explanations for the test cases of the example: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
98211796 |
pashka |
A |
Nov. 12, 2020, 3:06 p.m. |
OK |
Kotlin |
TESTS |
3 |
93 |
0 |
|
|
98209027 |
chick_magnet |
A |
Nov. 12, 2020, 2:41 p.m. |
OK |
Kotlin |
TESTS |
3 |
93 |
0 |
|
|
98208603 |
timf1089 |
A |
Nov. 12, 2020, 2:38 p.m. |
OK |
Kotlin |
TESTS |
3 |
93 |
0 |
|
|
98208507 |
Spheniscine |
A |
Nov. 12, 2020, 2:37 p.m. |
OK |
Kotlin |
TESTS |
3 |
93 |
0 |
|
|
98216476 |
go_fuck_yourself |
A |
Nov. 12, 2020, 3:55 p.m. |
OK |
Kotlin |
TESTS |
3 |
108 |
0 |
|
|
98213737 |
babkabass |
A |
Nov. 12, 2020, 3:26 p.m. |
OK |
Kotlin |
TESTS |
3 |
108 |
0 |
|
|
98211668 |
BestPyroblastHunterEU |
A |
Nov. 12, 2020, 3:05 p.m. |
OK |
Kotlin |
TESTS |
3 |
108 |
0 |
|
|
98210882 |
Ayyyoub |
A |
Nov. 12, 2020, 2:57 p.m. |
OK |
Kotlin |
TESTS |
3 |
108 |
0 |
|
|
98210543 |
dakshkamboj |
A |
Nov. 12, 2020, 2:54 p.m. |
OK |
Kotlin |
TESTS |
3 |
108 |
0 |
|
|
98210208 |
CryMeANile |
A |
Nov. 12, 2020, 2:51 p.m. |
OK |
Kotlin |
TESTS |
3 |
108 |
0 |
|
|
remove filters
Back to search problems