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 given an array a of length 2n . Consider a partition of array a into two subsequences p and q of length n each (each element of array a should be in exactly one subsequence: either in p or in q ). Let's sort p in non-decreasing order, and q in non-increasing order, we can denote the sorted versions by x and y , respectively. Then the cost of a partition is defined as f(p, q) = sum_{i = 1}^n |x_i - y_i| . Find the sum of f(p, q) over all correct partitions of array a . Since the answer might be too big, print its remainder modulo 998244353 . The first line contains a single integer n ( 1 <= q n <= q 150 ,000 ). The second line contains 2n integers a_1, a_2, ldots, a_{2n} ( 1 <= q a_i <= q 10^9 ) -- elements of array a . Print one integer -- the answer to the problem, modulo 998244353 . Two partitions of an array are considered different if the sets of indices of elements included in the subsequence p are different. In the first example, there are two correct partitions of the array a : In the second example, there are six valid partitions of the array a : "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
97320374 |
Gassa |
B |
Nov. 1, 2020, 11:33 a.m. |
OK |
D |
TESTS |
42 |
171 |
13516800 |
|
|
97304829 |
hos.lyric |
B |
Nov. 1, 2020, 11:08 a.m. |
OK |
D |
TESTS |
42 |
249 |
44851200 |
|
|
97359961 |
Pengzhike |
B |
Nov. 1, 2020, 2 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
61 |
1228800 |
|
|
97389628 |
Eric_Aslan |
B |
Nov. 2, 2020, 12:02 a.m. |
OK |
GNU C++11 |
TESTS |
43 |
62 |
1228800 |
|
|
97330130 |
jiangxuancheng |
B |
Nov. 1, 2020, 11:55 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
62 |
1228800 |
|
|
97328009 |
CYJian |
B |
Nov. 1, 2020, 11:50 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
62 |
1433600 |
|
|
97355831 |
ZYF_B |
B |
Nov. 1, 2020, 1:27 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
62 |
1638400 |
|
|
97335815 |
fhs_lsqs |
B |
Nov. 1, 2020, 12:09 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
62 |
1843200 |
|
|
97332485 |
Yuzu-soft |
B |
Nov. 1, 2020, 12:01 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
62 |
2048000 |
|
|
97357442 |
wyzwyz |
B |
Nov. 1, 2020, 1:37 p.m. |
OK |
GNU C++11 |
TESTS |
42 |
62 |
2252800 |
|
|
97321169 |
Froggygua |
B |
Nov. 1, 2020, 11:35 a.m. |
OK |
GNU C++11 |
TESTS |
42 |
62 |
2457600 |
|
|
97360623 |
luckyblock233 |
B |
Nov. 1, 2020, 2:07 p.m. |
OK |
GNU C++11 |
TESTS |
43 |
62 |
3379200 |
|
|
97357110 |
shirakami_fbk |
B |
Nov. 1, 2020, 1:35 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
62 |
37068800 |
|
|
97338041 |
SidneyMars |
B |
Nov. 1, 2020, 12:15 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
93 |
2355200 |
|
|
97323745 |
kimjihoon |
B |
Nov. 1, 2020, 11:40 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
124 |
1228800 |
|
|
97315958 |
danya090699 |
B |
Nov. 1, 2020, 11:25 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
124 |
1228800 |
|
|
97319149 |
foothai |
B |
Nov. 1, 2020, 11:31 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
124 |
1228800 |
|
|
97375113 |
GregFocker |
B |
Nov. 1, 2020, 5:14 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
124 |
1228800 |
|
|
97357679 |
Devil |
B |
Nov. 1, 2020, 1:39 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
124 |
1228800 |
|
|
97341573 |
marcOS |
B |
Nov. 1, 2020, 12:26 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
124 |
1228800 |
|
|
97337267 |
purinliang |
B |
Nov. 1, 2020, 12:13 p.m. |
OK |
GNU C++14 |
TESTS |
42 |
124 |
1228800 |
|
|
97322058 |
MaGaroo |
B |
Nov. 1, 2020, 11:37 a.m. |
OK |
GNU C++14 |
TESTS |
42 |
124 |
2355200 |
|
|
97344234 |
yukihana0416 |
B |
Nov. 1, 2020, 12:34 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
62 |
16793600 |
|
|
97317836 |
LayCurse |
B |
Nov. 1, 2020, 11:28 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
62 |
101888000 |
|
|
97359171 |
nauynix |
B |
Nov. 1, 2020, 1:53 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
109 |
3584000 |
|
|
97315650 |
Hazyknight |
B |
Nov. 1, 2020, 11:24 a.m. |
OK |
GNU C++17 |
TESTS |
42 |
109 |
6041600 |
|
|
97356269 |
schtomi97 |
B |
Nov. 1, 2020, 1:29 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
124 |
1228800 |
|
|
97346983 |
Sunnat |
B |
Nov. 1, 2020, 12:43 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
124 |
1228800 |
|
|
97351269 |
Jon |
B |
Nov. 1, 2020, 12:56 p.m. |
OK |
GNU C++17 |
TESTS |
42 |
124 |
1228800 |
|
|
97369450 |
Sin_Sak |
B |
Nov. 1, 2020, 3:50 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
124 |
1228800 |
|
|
97368722 |
I_love_chickpea |
B |
Nov. 1, 2020, 3:40 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
124 |
1228800 |
|
|
97361027 |
Derzeed |
B |
Nov. 1, 2020, 2:11 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
124 |
1228800 |
|
|
97322404 |
RiverHamster |
B |
Nov. 1, 2020, 11:37 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
61 |
7782400 |
|
|
97332472 |
antguz |
B |
Nov. 1, 2020, 12:01 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
78 |
2457600 |
|
|
97316847 |
Origenes |
B |
Nov. 1, 2020, 11:26 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
78 |
3788800 |
|
|
97359289 |
AceKing |
B |
Nov. 1, 2020, 1:54 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
92 |
1228800 |
|
|
97315571 |
blackbori |
B |
Nov. 1, 2020, 11:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
92 |
4915200 |
|
|
97370825 |
Harshlyn94 |
B |
Nov. 1, 2020, 4:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
93 |
1228800 |
|
|
97378653 |
kvk1920 |
B |
Nov. 1, 2020, 6:12 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
93 |
1228800 |
|
|
97368638 |
Harshlyn94 |
B |
Nov. 1, 2020, 3:39 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
93 |
1228800 |
|
|
97362316 |
GRT_2018 |
B |
Nov. 1, 2020, 2:26 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
93 |
1228800 |
|
|
97332868 |
sheaf |
B |
Nov. 1, 2020, 12:02 p.m. |
OK |
GNU C++17 (64) |
TESTS |
42 |
93 |
1228800 |
|
|
97394370 |
skittles1412 |
B |
Nov. 2, 2020, 3:12 a.m. |
OK |
Java 11 |
TESTS |
43 |
248 |
409600 |
|
|
97331628 |
uwi |
B |
Nov. 1, 2020, 11:59 a.m. |
OK |
Java 11 |
TESTS |
42 |
249 |
0 |
|
|
97387423 |
Ahmad |
B |
Nov. 1, 2020, 10:01 p.m. |
OK |
Java 11 |
TESTS |
43 |
264 |
0 |
|
|
97331398 |
fpeterfalvi |
B |
Nov. 1, 2020, 11:58 a.m. |
OK |
Java 11 |
TESTS |
42 |
311 |
11161600 |
|
|
97383800 |
rreeennnnn |
B |
Nov. 1, 2020, 8 p.m. |
OK |
Java 11 |
TESTS |
43 |
358 |
6656000 |
|
|
97318200 |
mphillotry |
B |
Nov. 1, 2020, 11:29 a.m. |
OK |
Java 11 |
TESTS |
42 |
389 |
4710400 |
|
|
97346600 |
Apfeloxid |
B |
Nov. 1, 2020, 12:41 p.m. |
OK |
Java 11 |
TESTS |
42 |
467 |
6451200 |
|
|
97339549 |
dusty.and.rusty |
B |
Nov. 1, 2020, 12:20 p.m. |
OK |
Java 11 |
TESTS |
42 |
483 |
30515200 |
|
|
97336641 |
cwise |
B |
Nov. 1, 2020, 12:12 p.m. |
OK |
Java 8 |
TESTS |
42 |
171 |
0 |
|
|
97326003 |
adp527 |
B |
Nov. 1, 2020, 11:45 a.m. |
OK |
Java 8 |
TESTS |
42 |
202 |
17100800 |
|
|
97356569 |
an09mous |
B |
Nov. 1, 2020, 1:31 p.m. |
OK |
Java 8 |
TESTS |
42 |
249 |
15769600 |
|
|
97340145 |
SaveVMK |
B |
Nov. 1, 2020, 12:22 p.m. |
OK |
Java 8 |
TESTS |
42 |
280 |
132710400 |
|
|
97370103 |
Hemose |
B |
Nov. 1, 2020, 3:59 p.m. |
OK |
Java 8 |
TESTS |
43 |
296 |
14131200 |
|
|
97381413 |
ZerooCool |
B |
Nov. 1, 2020, 7:05 p.m. |
OK |
Java 8 |
TESTS |
43 |
311 |
14131200 |
|
|
97327416 |
reborn.chris |
B |
Nov. 1, 2020, 11:48 a.m. |
OK |
Java 8 |
TESTS |
42 |
343 |
12800000 |
|
|
97346038 |
golions |
B |
Nov. 1, 2020, 12:39 p.m. |
OK |
Java 8 |
TESTS |
42 |
452 |
10752000 |
|
|
97364406 |
YahiaSherif |
B |
Nov. 1, 2020, 2:49 p.m. |
OK |
Java 8 |
TESTS |
43 |
498 |
13721600 |
|
|
97331673 |
xwchen |
B |
Nov. 1, 2020, 11:59 a.m. |
OK |
Java 8 |
TESTS |
42 |
514 |
13312000 |
|
|
97347194 |
Electromaster |
B |
Nov. 1, 2020, 12:43 p.m. |
OK |
Kotlin |
TESTS |
42 |
545 |
28569600 |
|
|
97316318 |
darnley |
B |
Nov. 1, 2020, 11:25 a.m. |
OK |
Kotlin |
TESTS |
42 |
716 |
36556800 |
|
|
97356145 |
EvgeniusASPX |
B |
Nov. 1, 2020, 1:28 p.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
140 |
4812800 |
|
|
97351571 |
AnnSuperstar |
B |
Nov. 1, 2020, 12:57 p.m. |
OK |
MS C++ 2017 |
TESTS |
42 |
343 |
2457600 |
|
|
97400433 |
g-point |
B |
Nov. 2, 2020, 5:47 a.m. |
OK |
MS C++ 2017 |
TESTS |
43 |
390 |
1740800 |
|
|
97360807 |
Gravekper |
B |
Nov. 1, 2020, 2:09 p.m. |
OK |
MS C++ 2017 |
TESTS |
43 |
889 |
2457600 |
|
|
97352750 |
mban259 |
B |
Nov. 1, 2020, 1 p.m. |
OK |
.NET Core C# |
TESTS |
42 |
186 |
39014400 |
|
|
97329682 |
azukun |
B |
Nov. 1, 2020, 11:54 a.m. |
OK |
.NET Core C# |
TESTS |
42 |
187 |
40550400 |
|
|
97312176 |
keymoon |
B |
Nov. 1, 2020, 11:18 a.m. |
OK |
.NET Core C# |
TESTS |
42 |
264 |
48435200 |
|
|
97315922 |
tamato |
B |
Nov. 1, 2020, 11:24 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
249 |
23449600 |
|
|
97321631 |
nagiss |
B |
Nov. 1, 2020, 11:36 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
311 |
28876800 |
|
|
97374183 |
notbot |
B |
Nov. 1, 2020, 5 p.m. |
OK |
PyPy 3 |
TESTS |
43 |
358 |
28569600 |
|
|
97320351 |
kclee2172 |
B |
Nov. 1, 2020, 11:33 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
405 |
28876800 |
|
|
97398529 |
manhar |
B |
Nov. 2, 2020, 5:07 a.m. |
OK |
PyPy 3 |
TESTS |
43 |
452 |
62566400 |
|
|
97374440 |
TheVan |
B |
Nov. 1, 2020, 5:03 p.m. |
OK |
PyPy 3 |
TESTS |
43 |
482 |
26521600 |
|
|
97373793 |
TheVan |
B |
Nov. 1, 2020, 4:54 p.m. |
OK |
PyPy 3 |
TESTS |
43 |
482 |
26521600 |
|
|
97375121 |
cyanfirestone |
B |
Nov. 1, 2020, 5:14 p.m. |
OK |
PyPy 3 |
TESTS |
43 |
499 |
35123200 |
|
|
97318544 |
conqueror_of_tourist |
B |
Nov. 1, 2020, 11:29 a.m. |
OK |
PyPy 3 |
TESTS |
42 |
514 |
34406400 |
|
|
97385178 |
silvertint |
B |
Nov. 1, 2020, 8:40 p.m. |
OK |
PyPy 3 |
TESTS |
43 |
530 |
34406400 |
|
|
97372861 |
Lithosphere |
B |
Nov. 1, 2020, 4:38 p.m. |
OK |
Python 3 |
TESTS |
43 |
452 |
24576000 |
|
|
97320958 |
sansen |
B |
Nov. 1, 2020, 11:34 a.m. |
OK |
Rust |
TESTS |
42 |
78 |
9011200 |
|
|
97320460 |
ngtkana |
B |
Nov. 1, 2020, 11:33 a.m. |
OK |
Rust |
TESTS |
42 |
155 |
22425600 |
|
|
remove filters
Back to search problems