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'Kavi has 2n points lying on the OX axis, i -th of which is located at x = i . Kavi considers all ways to split these 2n points into n pairs. Among those, he is interested in good pairings, which are defined as follows: Consider n segments with ends at the points in correspondent pairs. The pairing is called good, if for every 2 different segments A and B among those, at least one of the following holds: Consider the following example: A is a good pairing since the red segment lies completely inside the blue segment. B is a good pairing since the red and the blue segment have the same length. C is not a good pairing since none of the red or blue segments lies inside the other, neither do they have the same size. Kavi is interested in the number of good pairings, so he wants you to find it for him. As the result can be large, find this number modulo 998244353 . Two pairings are called different, if some two points are in one pair in some pairing and in different pairs in another. The single line of the input contains a single integer n (1 <= n <= 10^6) . Print the number of good pairings modulo 998244353 . The good pairings for the second example are: In the third example, the good pairings are: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
117213116 |
Gassa |
B |
May 24, 2021, 3:14 p.m. |
OK |
D |
TESTS |
14 |
46 |
20172800 |
|
|
117258993 |
The_Trout |
B |
May 24, 2021, 6:06 p.m. |
OK |
GNU C11 |
TESTS |
14 |
61 |
3993600 |
|
|
117200950 |
ADMathNoob |
B |
May 24, 2021, 2:55 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
31 |
11980800 |
|
|
117214708 |
clfzs |
B |
May 24, 2021, 3:16 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
31 |
21094400 |
|
|
117220254 |
calabashgirl |
B |
May 24, 2021, 3:27 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
31 |
24064000 |
|
|
117210683 |
AC-Evil |
B |
May 24, 2021, 3:10 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
31 |
24064000 |
|
|
117272661 |
AquaMoon |
B |
May 25, 2021, 12:24 a.m. |
OK |
GNU C++11 |
TESTS |
14 |
46 |
3993600 |
|
|
117202576 |
Inf_Voltage |
B |
May 24, 2021, 2:57 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
46 |
3993600 |
|
|
117204660 |
MoRanSky |
B |
May 24, 2021, 3 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
46 |
3993600 |
|
|
117278663 |
Arkmaki |
B |
May 25, 2021, 3:25 a.m. |
OK |
GNU C++11 |
TESTS |
14 |
46 |
3993600 |
|
|
117274758 |
moyan1082 |
B |
May 25, 2021, 1:50 a.m. |
OK |
GNU C++11 |
TESTS |
14 |
46 |
3993600 |
|
|
117242922 |
2683331518 |
B |
May 24, 2021, 4:21 p.m. |
OK |
GNU C++11 |
TESTS |
14 |
46 |
3993600 |
|
|
117199335 |
krijgertje |
B |
May 24, 2021, 2:53 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
31 |
12083200 |
|
|
117197139 |
peehs_moorhsum |
B |
May 24, 2021, 2:50 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
3993600 |
|
|
117199663 |
ngpin04 |
B |
May 24, 2021, 2:53 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
3993600 |
|
|
117209338 |
Gioto |
B |
May 24, 2021, 3:08 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
3993600 |
|
|
117215874 |
Tima |
B |
May 24, 2021, 3:18 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
7987200 |
|
|
117202087 |
_no0B |
B |
May 24, 2021, 2:57 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
7987200 |
|
|
117205860 |
George1123 |
B |
May 24, 2021, 3:02 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
7987200 |
|
|
117288181 |
A.K.E.E. |
B |
May 25, 2021, 5:58 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
7987200 |
|
|
117237269 |
Adibov |
B |
May 24, 2021, 4:05 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
7987200 |
|
|
117210552 |
espr1t |
B |
May 24, 2021, 3:10 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
7987200 |
|
|
117285005 |
o0O0o0O0o0O0o |
B |
May 25, 2021, 5:16 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
31 |
7987200 |
|
|
117200769 |
maximumSHOT |
B |
May 24, 2021, 2:55 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
31 |
7987200 |
|
|
117275007 |
iaNTU |
B |
May 25, 2021, 1:59 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
31 |
8704000 |
|
|
117271278 |
universe- |
B |
May 24, 2021, 11:15 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
31 |
11980800 |
|
|
117257655 |
momenta |
B |
May 24, 2021, 5:50 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
3993600 |
|
|
117267500 |
gromperen |
B |
May 24, 2021, 8:47 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
3993600 |
|
|
117266975 |
smsarfroz78 |
B |
May 24, 2021, 8:32 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
3993600 |
|
|
117266102 |
57417erlp2GPq9cYqEX |
B |
May 24, 2021, 8:12 p.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
3993600 |
|
|
117284469 |
He110W012LD |
B |
May 25, 2021, 5:09 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
3993600 |
|
|
117280315 |
Ag2303 |
B |
May 25, 2021, 4 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
3993600 |
|
|
117198721 |
natsugiri |
B |
May 24, 2021, 2:52 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
3993600 |
|
|
117197536 |
DreamingLeaf |
B |
May 24, 2021, 2:51 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
3993600 |
|
|
117202749 |
Xylenox |
B |
May 24, 2021, 2:58 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
3993600 |
|
|
117212496 |
suta |
B |
May 24, 2021, 3:13 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
4096000 |
|
|
117240001 |
FairyWinx |
B |
May 24, 2021, 4:13 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
7987200 |
|
|
117199182 |
elbrunovsky |
B |
May 24, 2021, 2:53 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
11980800 |
|
|
117196027 |
mango_lassi |
B |
May 24, 2021, 2:49 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
29184000 |
|
|
117229033 |
gyouzasushi |
B |
May 24, 2021, 3:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
46 |
3993600 |
|
|
117265239 |
keko37 |
B |
May 24, 2021, 7:51 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
46 |
3993600 |
|
|
117234965 |
hltk |
B |
May 24, 2021, 3:59 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
46 |
3993600 |
|
|
117221109 |
clyring |
B |
May 24, 2021, 3:28 p.m. |
OK |
Haskell |
TESTS |
14 |
202 |
4300800 |
|
|
117215109 |
cirno3153 |
B |
May 24, 2021, 3:17 p.m. |
OK |
Java 11 |
TESTS |
14 |
218 |
0 |
|
|
117207454 |
Hemose |
B |
May 24, 2021, 3:05 p.m. |
OK |
Java 11 |
TESTS |
14 |
233 |
8192000 |
|
|
117209771 |
martins |
B |
May 24, 2021, 3:08 p.m. |
OK |
Java 11 |
TESTS |
14 |
233 |
16179200 |
|
|
117195276 |
uwi |
B |
May 24, 2021, 2:48 p.m. |
OK |
Java 11 |
TESTS |
14 |
264 |
0 |
|
|
117271056 |
asamanta |
B |
May 24, 2021, 11:03 p.m. |
OK |
Java 11 |
TESTS |
14 |
264 |
16588800 |
|
|
117260132 |
MaeroMero |
B |
May 24, 2021, 6:21 p.m. |
OK |
Java 11 |
TESTS |
14 |
280 |
6963200 |
|
|
117232375 |
Apfeloxid |
B |
May 24, 2021, 3:53 p.m. |
OK |
Java 11 |
TESTS |
14 |
280 |
8908800 |
|
|
117246231 |
baron_ |
B |
May 24, 2021, 4:32 p.m. |
OK |
Java 11 |
TESTS |
14 |
296 |
16588800 |
|
|
117211129 |
LNB |
B |
May 24, 2021, 3:10 p.m. |
OK |
Java 11 |
TESTS |
14 |
296 |
24576000 |
|
|
117211546 |
nick_301 |
B |
May 24, 2021, 3:11 p.m. |
OK |
Java 11 |
TESTS |
14 |
311 |
16486400 |
|
|
117209512 |
fetetriste |
B |
May 24, 2021, 3:08 p.m. |
OK |
Java 8 |
TESTS |
14 |
140 |
0 |
|
|
117239671 |
ika |
B |
May 24, 2021, 4:12 p.m. |
OK |
Java 8 |
TESTS |
14 |
171 |
3072000 |
|
|
117209228 |
dalt |
B |
May 24, 2021, 3:07 p.m. |
OK |
Java 8 |
TESTS |
14 |
248 |
16384000 |
|
|
117218869 |
hu_tao |
B |
May 24, 2021, 3:24 p.m. |
OK |
Java 8 |
TESTS |
14 |
280 |
5529600 |
|
|
117227494 |
YahiaSherif |
B |
May 24, 2021, 3:42 p.m. |
OK |
Java 8 |
TESTS |
14 |
280 |
21913600 |
|
|
117220916 |
wphsucf |
B |
May 24, 2021, 3:28 p.m. |
OK |
Java 8 |
TESTS |
14 |
420 |
6860800 |
|
|
117273643 |
Spheniscine |
B |
May 25, 2021, 1:06 a.m. |
OK |
Kotlin |
TESTS |
14 |
140 |
0 |
|
|
117228376 |
Hakiobo |
B |
May 24, 2021, 3:44 p.m. |
OK |
Kotlin |
TESTS |
14 |
249 |
19046400 |
|
|
117190908 |
Tlatoani |
B |
May 24, 2021, 2:44 p.m. |
OK |
Kotlin |
TESTS |
14 |
280 |
8396800 |
|
|
117254468 |
gevak |
B |
May 24, 2021, 5:22 p.m. |
OK |
MS C++ |
TESTS |
14 |
296 |
51507200 |
|
|
117270032 |
grey |
B |
May 24, 2021, 10:10 p.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
139 |
16076800 |
|
|
117204308 |
Madball |
B |
May 24, 2021, 3 p.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
498 |
3993600 |
|
|
117217876 |
tarattata1 |
B |
May 24, 2021, 3:22 p.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
638 |
66355200 |
|
|
117218734 |
azukun |
B |
May 24, 2021, 3:24 p.m. |
OK |
.NET Core C# |
TESTS |
14 |
109 |
3891200 |
|
|
117196900 |
riantkb |
B |
May 24, 2021, 2:50 p.m. |
OK |
.NET Core C# |
TESTS |
14 |
187 |
7987200 |
|
|
117218676 |
Yupiteru |
B |
May 24, 2021, 3:24 p.m. |
OK |
.NET Core C# |
TESTS |
14 |
202 |
15974400 |
|
|
117209968 |
fairy_lettuce |
B |
May 24, 2021, 3:09 p.m. |
OK |
.NET Core C# |
TESTS |
14 |
482 |
15769600 |
|
|
117211949 |
nwi |
B |
May 24, 2021, 3:12 p.m. |
OK |
PyPy 2 |
TESTS |
14 |
170 |
4198400 |
|
|
117229245 |
bcollet |
B |
May 24, 2021, 3:46 p.m. |
OK |
PyPy 2 |
TESTS |
14 |
202 |
8396800 |
|
|
117207787 |
dolphinigle |
B |
May 24, 2021, 3:05 p.m. |
OK |
PyPy 2 |
TESTS |
14 |
405 |
12492800 |
|
|
117263699 |
Aman113114_Bansal |
B |
May 24, 2021, 7:19 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
155 |
5324800 |
|
|
117220945 |
Kiri8128 |
B |
May 24, 2021, 3:28 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
171 |
14028800 |
|
|
117276597 |
SF-Manman |
B |
May 25, 2021, 2:42 a.m. |
OK |
PyPy 3 |
TESTS |
14 |
186 |
5324800 |
|
|
117278225 |
189X1A05B3 |
B |
May 25, 2021, 3:16 a.m. |
OK |
PyPy 3 |
TESTS |
14 |
202 |
5324800 |
|
|
117201799 |
googol_S0 |
B |
May 24, 2021, 2:56 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
202 |
17305600 |
|
|
117224284 |
not_tehlka |
B |
May 24, 2021, 3:35 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
233 |
15052800 |
|
|
117220618 |
codicon |
B |
May 24, 2021, 3:27 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
249 |
13414400 |
|
|
117280359 |
ABhi_gyan |
B |
May 25, 2021, 4:01 a.m. |
OK |
PyPy 3 |
TESTS |
14 |
264 |
5734400 |
|
|
117221273 |
shuyefan |
B |
May 24, 2021, 3:29 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
265 |
9216000 |
|
|
117218129 |
titia |
B |
May 24, 2021, 3:22 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
295 |
26009600 |
|
|
117225537 |
toomer |
B |
May 24, 2021, 3:38 p.m. |
OK |
Rust |
TESTS |
14 |
46 |
1945600 |
|
|
117205745 |
shino16 |
B |
May 24, 2021, 3:02 p.m. |
OK |
Rust |
TESTS |
14 |
93 |
3993600 |
|
|
117200293 |
sansen |
B |
May 24, 2021, 2:54 p.m. |
OK |
Rust |
TESTS |
14 |
93 |
3993600 |
|
|
117209615 |
cottoncotton |
B |
May 24, 2021, 3:08 p.m. |
OK |
Rust |
TESTS |
14 |
93 |
4300800 |
|
|
117228402 |
orz_liuwei |
B |
May 24, 2021, 3:44 p.m. |
OK |
Rust |
TESTS |
14 |
202 |
11980800 |
|
|
remove filters
Back to search problems