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.
Problems
B"You are creating a level for a video game. The level consists of n rooms placed in a circle. The rooms are numbered 1 through n . Each room contains exactly one exit: completing the j -th room allows you to go the (j+1) -th room (and completing the n -th room allows you to go the 1 -st room). You are given the description of the multiset of n chests: the i -th chest has treasure value c_i . Each chest can be of one of two types: The player starts in a random room with each room having an equal probability of being chosen. The players earnings is equal to the total value of treasure chests he'd collected before he lost. You are allowed to choose the order the chests go into the rooms. For each k from 1 to n place the chests into the rooms in such a way that: Please note that for each k the placement is chosen independently. It can be shown that it is in the form of frac{P}{Q} where P and Q are non-negative integers and Q ne 0 . Report the values of P cdot Q^{-1} pmod {998244353} . The first contains a single integer n ( 2 <= n <= 3 cdot 10^5 ) -- the number of rooms and the number of chests. The second line contains n integers c_1, c_2, ... , c_n ( 1 <= c_i <= 10^6 ) -- the treasure values of each chest. Print n integers -- the k -th value should be equal to the minimum possible expected value of players earnings if the chests are placed into the rooms in some order and exactly k of the chests are mimics. It can be shown that it is in the form of frac{P}{Q} where P and Q are non-negative integers and Q ne 0 . Report the values of P cdot Q^{-1} pmod {998244353} . In the first example the exact values of minimum expected values are: frac 1 2 , frac 0 2 . In the second example the exact values of minimum expected values are: frac{132} 8 , frac"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
86714437 |
LJC00118 |
G |
July 13, 2020, 3:20 a.m. |
OK |
GNU C++11 |
TESTS |
16 |
109 |
5120000 |
|
|
86709784 |
Frame233 |
G |
July 13, 2020, 12:03 a.m. |
OK |
GNU C++11 |
TESTS |
16 |
139 |
7475200 |
|
|
86709734 |
Frame233 |
G |
July 13, 2020, 12:01 a.m. |
OK |
GNU C++11 |
TESTS |
16 |
140 |
6348800 |
|
|
86701289 |
The.Last.Wizard |
G |
July 12, 2020, 7:02 p.m. |
OK |
GNU C++11 |
TESTS |
16 |
155 |
6246400 |
|
|
86710010 |
scimoon |
G |
July 13, 2020, 12:17 a.m. |
OK |
GNU C++11 |
TESTS |
16 |
171 |
8704000 |
|
|
86714628 |
CN_zwang2002 |
G |
July 13, 2020, 3:25 a.m. |
OK |
GNU C++11 |
TESTS |
16 |
202 |
7475200 |
|
|
86689465 |
Pyqe |
G |
July 12, 2020, 4:39 p.m. |
OK |
GNU C++11 |
TESTS |
16 |
218 |
8704000 |
|
|
86709735 |
caidzh |
G |
July 13, 2020, 12:01 a.m. |
OK |
GNU C++11 |
TESTS |
16 |
280 |
6553600 |
|
|
86685575 |
Forever_Pursuit |
G |
July 12, 2020, 4:17 p.m. |
OK |
GNU C++11 |
TESTS |
16 |
311 |
13209600 |
|
|
86712413 |
YJJ_Konnyaku |
G |
July 13, 2020, 2:10 a.m. |
OK |
GNU C++11 |
TESTS |
16 |
343 |
11161600 |
|
|
86684314 |
Temirulan |
G |
July 12, 2020, 4:10 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
217 |
8601600 |
|
|
86695315 |
dlalswp25 |
G |
July 12, 2020, 5:24 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
218 |
8601600 |
|
|
86687712 |
George1123 |
G |
July 12, 2020, 4:28 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
311 |
6144000 |
|
|
86699303 |
xb0nS |
G |
July 12, 2020, 6:23 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
343 |
7372800 |
|
|
86711242 |
rama_pang |
G |
July 13, 2020, 1:21 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
343 |
9318400 |
|
|
86701635 |
keko37 |
G |
July 12, 2020, 7:10 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
390 |
6144000 |
|
|
86702450 |
WhaleVomit |
G |
July 12, 2020, 7:29 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
483 |
8499200 |
|
|
86696654 |
kamer |
G |
July 12, 2020, 5:41 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
748 |
8499200 |
|
|
86688237 |
LayCurse |
G |
July 12, 2020, 4:31 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
171 |
106803200 |
|
|
86685201 |
natsugiri |
G |
July 12, 2020, 4:15 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
187 |
6144000 |
|
|
86697342 |
cookiedoth |
G |
July 12, 2020, 5:50 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
202 |
8601600 |
|
|
86709131 |
tinca_matei |
G |
July 12, 2020, 11:21 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
217 |
6144000 |
|
|
86693764 |
solaimanope |
G |
July 12, 2020, 5:10 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
218 |
6144000 |
|
|
86707287 |
12tqian |
G |
July 12, 2020, 9:55 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
218 |
6348800 |
|
|
86685196 |
oleh1421 |
G |
July 12, 2020, 4:15 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
218 |
10035200 |
|
|
86697074 |
Tanmay_21 |
G |
July 12, 2020, 5:47 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
233 |
7372800 |
|
|
86714270 |
cypherop |
G |
July 13, 2020, 3:15 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
234 |
15155200 |
|
|
86697905 |
Ronnie007 |
G |
July 12, 2020, 6 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
249 |
7372800 |
|
|
86701098 |
lightseba |
G |
July 12, 2020, 6:58 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
124 |
11571200 |
|
|
86716739 |
neal |
G |
July 13, 2020, 4:27 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
155 |
7884800 |
|
|
86677566 |
Geothermal |
G |
July 12, 2020, 3:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
155 |
7884800 |
|
|
86679983 |
.__. |
G |
July 12, 2020, 3:52 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
156 |
9113600 |
|
|
86710002 |
wwdd |
G |
July 13, 2020, 12:17 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
170 |
15872000 |
|
|
86693739 |
Marckess |
G |
July 12, 2020, 5:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
171 |
13926400 |
|
|
86713940 |
timf1089 |
G |
July 13, 2020, 3:03 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
186 |
5529600 |
|
|
86714572 |
emorgan5289 |
G |
July 13, 2020, 3:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
186 |
9113600 |
|
|
86708781 |
victoragnez |
G |
July 12, 2020, 11:01 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
186 |
10956800 |
|
|
86706153 |
tugsuu |
G |
July 12, 2020, 9:13 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
202 |
9113600 |
|
|
86691797 |
uwi |
G |
July 12, 2020, 4:56 p.m. |
OK |
Java 11 |
TESTS |
16 |
311 |
24166400 |
|
|
86718628 |
AnandOza |
G |
July 13, 2020, 5:07 a.m. |
OK |
Java 8 |
TESTS |
16 |
389 |
28057600 |
|
|
86702098 |
qlf9 |
G |
July 12, 2020, 7:20 p.m. |
OK |
Java 8 |
TESTS |
16 |
436 |
39424000 |
|
|
86708370 |
MagentaCobra |
G |
July 12, 2020, 10:38 p.m. |
OK |
Java 8 |
TESTS |
16 |
452 |
39321600 |
|
|
86693171 |
Tlatoani |
G |
July 12, 2020, 5:06 p.m. |
OK |
Kotlin |
TESTS |
16 |
467 |
49459200 |
|
|
86698838 |
golions |
G |
July 12, 2020, 6:15 p.m. |
OK |
Kotlin |
TESTS |
16 |
592 |
51712000 |
|
|
remove filters
Back to search problems