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'Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands. Monocarp 's empire has n cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one Monument per turn. Monocarp has m points on the map he 'd like to control using the constructed Monuments. For each point he knows the distance between it and each city. Monuments work in the following way: when built in some city, a Monument controls all points at distance at most 1 to this city. Next turn, the Monument controls all points at distance at most 2 , the turn after -- at distance at most 3 , and so on. Monocarp will build n Monuments in n turns and his empire will conquer all points that are controlled by at least one Monument. Monocarp can 't figure out any strategy, so during each turn he will choose a city for a Monument randomly among all remaining cities (cities without Monuments). Monocarp wants to know how many points (among m of them) he will conquer at the end of turn number n . Help him to calculate the expected number of conquered points! The first line contains two integers n and m ( 1 <= n <= 20 ; 1 <= m <= 5 cdot 10^4 ) -- the number of cities and the number of points. Next n lines contains m integers each: the j -th integer of the i -th line d_{i, j} ( 1 <= d_{i, j} <= n + 1 ) is the distance between the i -th city and the j -th point. It can be shown that the expected number of points Monocarp conquers at the end of the n -th turn can be represented as an irreducible fraction frac{x}{y} . Print this fraction modulo 998 ,244 ,353 , i. e. value x cdot y^{-1} bmod 998244353 where y^{-1} is such number that y cdot y^{-1} bmod 998244353 = 1 . Let 's look at all possi'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
116390603 |
sgtlaugh |
E |
May 16, 2021, 10:32 a.m. |
OK |
GNU C11 |
TESTS |
30 |
249 |
5017600 |
|
|
116437548 |
Werner_Yin |
E |
May 16, 2021, 10:23 p.m. |
OK |
GNU C++11 |
TESTS |
30 |
61 |
5120000 |
|
|
116385534 |
nianheng233 |
E |
May 16, 2021, 9:58 a.m. |
OK |
GNU C++11 |
TESTS |
30 |
62 |
4198400 |
|
|
116445184 |
zzctommy |
E |
May 17, 2021, 3:43 a.m. |
OK |
GNU C++11 |
TESTS |
30 |
62 |
4403200 |
|
|
116439274 |
ynycoding |
E |
May 16, 2021, 11:59 p.m. |
OK |
GNU C++11 |
TESTS |
30 |
156 |
4198400 |
|
|
116418023 |
randop |
E |
May 16, 2021, 3:41 p.m. |
OK |
GNU C++11 |
TESTS |
30 |
156 |
5017600 |
|
|
116448619 |
czyer |
E |
May 17, 2021, 5 a.m. |
OK |
GNU C++11 |
TESTS |
30 |
171 |
4198400 |
|
|
116385289 |
hnust_zhuhongye |
E |
May 16, 2021, 9:58 a.m. |
OK |
GNU C++11 |
TESTS |
30 |
171 |
5017600 |
|
|
116421213 |
wenzhuan |
E |
May 16, 2021, 4:24 p.m. |
OK |
GNU C++11 |
TESTS |
30 |
186 |
5017600 |
|
|
116412547 |
zaozao_zmx1 |
E |
May 16, 2021, 2:37 p.m. |
OK |
GNU C++11 |
TESTS |
30 |
187 |
9625600 |
|
|
116389845 |
Darko1227 |
E |
May 16, 2021, 10:25 a.m. |
OK |
GNU C++11 |
TESTS |
30 |
202 |
6860800 |
|
|
116420613 |
tokitsukaze |
E |
May 16, 2021, 4:15 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
77 |
4710400 |
|
|
116418958 |
st1vdy |
E |
May 16, 2021, 3:53 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
202 |
4403200 |
|
|
116419688 |
smasHR |
E |
May 16, 2021, 4:02 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
202 |
4403200 |
|
|
116392567 |
Farhod_Farmon |
E |
May 16, 2021, 10:52 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
217 |
4198400 |
|
|
116385601 |
buko |
E |
May 16, 2021, 9:59 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
218 |
4403200 |
|
|
116409877 |
megatron10599 |
E |
May 16, 2021, 2:04 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
218 |
5222400 |
|
|
116412934 |
RobeZH |
E |
May 16, 2021, 2:41 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
233 |
7987200 |
|
|
116448753 |
Immerser |
E |
May 17, 2021, 5:03 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
233 |
8601600 |
|
|
116438144 |
AlanSkarica |
E |
May 16, 2021, 10:56 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
249 |
4198400 |
|
|
116398525 |
lazyboy251 |
E |
May 16, 2021, 11:52 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
249 |
27033600 |
|
|
116414394 |
ironclad412 |
E |
May 16, 2021, 2:58 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
171 |
4403200 |
|
|
116450408 |
Isaunoya |
E |
May 17, 2021, 5:30 a.m. |
OK |
GNU C++17 |
TESTS |
30 |
171 |
4403200 |
|
|
116386811 |
Hi_rvn |
E |
May 16, 2021, 10:04 a.m. |
OK |
GNU C++17 |
TESTS |
30 |
171 |
4608000 |
|
|
116426877 |
yunjord |
E |
May 16, 2021, 5:51 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
186 |
4403200 |
|
|
116427019 |
yunjord |
E |
May 16, 2021, 5:53 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
186 |
4403200 |
|
|
116409888 |
142 |
E |
May 16, 2021, 2:04 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
186 |
4608000 |
|
|
116448294 |
2018LZY |
E |
May 17, 2021, 4:54 a.m. |
OK |
GNU C++17 |
TESTS |
30 |
186 |
4608000 |
|
|
116398007 |
1_16 |
E |
May 16, 2021, 11:46 a.m. |
OK |
GNU C++17 |
TESTS |
30 |
186 |
4812800 |
|
|
116397577 |
1_16 |
E |
May 16, 2021, 11:41 a.m. |
OK |
GNU C++17 |
TESTS |
30 |
186 |
4812800 |
|
|
116419270 |
EmZie |
E |
May 16, 2021, 3:57 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
186 |
5222400 |
|
|
116406956 |
generic_placeholder_name |
E |
May 16, 2021, 1:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
124 |
3993600 |
|
|
116444380 |
smax |
E |
May 17, 2021, 3:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
124 |
4198400 |
|
|
116437106 |
agarus |
E |
May 16, 2021, 10:01 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
124 |
4198400 |
|
|
116400267 |
mh755628 |
E |
May 16, 2021, 12:11 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
124 |
4198400 |
|
|
116388530 |
Sooh31 |
E |
May 16, 2021, 10:14 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
124 |
9318400 |
|
|
116422250 |
pikel_rik |
E |
May 16, 2021, 4:39 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
139 |
4198400 |
|
|
116390973 |
the_hyp0cr1t3 |
E |
May 16, 2021, 10:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
139 |
4198400 |
|
|
116434389 |
munghatekartik |
E |
May 16, 2021, 8:23 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
139 |
8396800 |
|
|
116390437 |
wyyxhjth |
E |
May 16, 2021, 10:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
139 |
8396800 |
|
|
116393823 |
Lolboyyyy |
E |
May 16, 2021, 11:05 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
139 |
8499200 |
|
|
116396530 |
0x3F |
E |
May 16, 2021, 11:30 a.m. |
OK |
Go |
TESTS |
30 |
109 |
614400 |
|
|
116396303 |
0x3F |
E |
May 16, 2021, 11:28 a.m. |
OK |
Go |
TESTS |
30 |
109 |
614400 |
|
|
116395339 |
0x3F |
E |
May 16, 2021, 11:19 a.m. |
OK |
Go |
TESTS |
30 |
436 |
4505600 |
|
|
116394972 |
0x3F |
E |
May 16, 2021, 11:16 a.m. |
OK |
Go |
TESTS |
30 |
436 |
4608000 |
|
|
116406202 |
7dan |
E |
May 16, 2021, 1:19 p.m. |
OK |
Java 8 |
TESTS |
30 |
202 |
0 |
|
|
116417342 |
YahiaSherif |
E |
May 16, 2021, 3:33 p.m. |
OK |
Java 8 |
TESTS |
30 |
233 |
0 |
|
|
116404798 |
O_E |
E |
May 16, 2021, 1:03 p.m. |
OK |
Java 8 |
TESTS |
30 |
280 |
409600 |
|
|
116404846 |
O_E |
E |
May 16, 2021, 1:03 p.m. |
OK |
Java 8 |
TESTS |
30 |
280 |
512000 |
|
|
116439591 |
TheSawan |
E |
May 17, 2021, 12:16 a.m. |
OK |
Java 8 |
TESTS |
30 |
327 |
2355200 |
|
|
116389709 |
pichulia |
E |
May 16, 2021, 10:24 a.m. |
OK |
MS C++ 2017 |
TESTS |
30 |
265 |
3993600 |
|
|
116427654 |
jimm89 |
E |
May 16, 2021, 6:04 p.m. |
OK |
PyPy 3 |
TESTS |
30 |
374 |
20070400 |
|
|
116388589 |
FlakeLCR |
E |
May 16, 2021, 10:15 a.m. |
OK |
PyPy 3 |
TESTS |
30 |
374 |
20275200 |
|
|
116385486 |
complexroots |
E |
May 16, 2021, 9:58 a.m. |
OK |
PyPy 3 |
TESTS |
30 |
576 |
17305600 |
|
|
116449171 |
dallasyan |
E |
May 17, 2021, 5:10 a.m. |
OK |
PyPy 3 |
TESTS |
30 |
623 |
22016000 |
|
|
116386629 |
huikang |
E |
May 16, 2021, 10:03 a.m. |
OK |
PyPy 3 |
TESTS |
30 |
811 |
20070400 |
|
|
116386370 |
huikang |
E |
May 16, 2021, 10:02 a.m. |
OK |
PyPy 3 |
TESTS |
30 |
857 |
19763200 |
|
|
116436453 |
codicon |
E |
May 16, 2021, 9:35 p.m. |
OK |
PyPy 3 |
TESTS |
30 |
1325 |
14848000 |
|
|
116418333 |
sh1194 |
E |
May 16, 2021, 3:45 p.m. |
OK |
Python 3 |
TESTS |
30 |
1356 |
7065600 |
|
|
116418459 |
sh1194 |
E |
May 16, 2021, 3:46 p.m. |
OK |
Python 3 |
TESTS |
30 |
1466 |
7168000 |
|
|
116418409 |
sh1194 |
E |
May 16, 2021, 3:46 p.m. |
OK |
Python 3 |
TESTS |
30 |
1482 |
6860800 |
|
|
116391658 |
komorin95 |
E |
May 16, 2021, 10:42 a.m. |
OK |
Rust |
TESTS |
30 |
108 |
13312000 |
|
|
remove filters
Back to search problems