Good Bye 2018

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
1091 Good Bye 2018 FINISHED False 9600 185642699 Dec. 30, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6811 ) D New Year and the Permutation Concatenation PROGRAMMING combinatorics dp math 1700

B'Let n be an integer. Consider all permutations on integers 1 to n in lexicographic order, and concatenate them into one big sequence p . For example, if n = 3 , then p = [1, 2, 3, 1, 3, 2, 2, 1, 3, 2, 3, 1, 3, 1, 2, 3, 2, 1] . The length of this sequence will be n cdot n! . Let 1 <= q i <= q j <= q n cdot n! be a pair of indices. We call the sequence (p_i, p_{i+1}, ... , p_{j-1}, p_j) a subarray of p . Its length is defined as the number of its elements, i.e., j - i + 1 . Its sum is the sum of all its elements, i.e., sum_{k=i}^j p_k . You are given n . Find the number of subarrays of p of length n having sum frac{n(n+1)}{2} . Since this number may be large, output it modulo 998244353 (a prime number). The only line contains one integer n ( 1 <= q n <= q 10^6 ), as described in the problem statement. Output a single integer -- the number of subarrays of length n having sum frac{n(n+1)}{2} , modulo 998244353 . In the first sample, there are 16 subarrays of length 3 . In order of appearance, they are: [1, 2, 3] , [2, 3, 1] , [3, 1, 3] , [1, 3, 2] , [3, 2, 2] , [2, 2, 1] , [2, 1, 3] , [1, 3, 2] , [3, 2, 3] , [2, 3, 1] , [3, 1, 3] , [1, 3, 1] , [3, 1, 2] , [1, 2, 3] , [2, 3, 2] , [3, 2, 1] . Their sums are 6 , 6 , 7 , 6 , 7 , 5 , 6 , 6 , 8 , 6 , 7 , 5 , 6 , 6 , 7 , 6 . As frac{n(n+1)}{2} = 6 , the answer is 9 . '...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
47767984 vatsal D Dec. 30, 2018, 6:59 p.m. OK Clang++17 Diagnostics TESTS 30 1871 32358400 1700
47746180 Gassa D Dec. 30, 2018, 3:21 p.m. OK D TESTS 30 46 0 1700
47759138 nanae1914 D Dec. 30, 2018, 4:31 p.m. OK D TESTS 30 124 24064000 1700
47789106 ia7ck D Dec. 31, 2018, 12:22 p.m. OK D TESTS 30 1045 24064000 1700
47789087 ia7ck D Dec. 31, 2018, 12:21 p.m. OK D TESTS 30 1060 24064000 1700
47766827 ruban D Dec. 30, 2018, 6:36 p.m. OK Delphi TESTS 30 514 27852800 1700
47784692 AHTOH._. D Dec. 31, 2018, 10:01 a.m. OK FPC TESTS 30 31 0 1700
47832333 Ahriman D Jan. 2, 2019, 7:50 a.m. OK FPC TESTS 30 46 0 1700
47775151 NewbieMisis D Dec. 31, 2018, 3 a.m. OK FPC TESTS 30 46 0 1700
47756398 samau07012005 D Dec. 30, 2018, 4:13 p.m. OK FPC TESTS 30 46 0 1700
47766857 ruban D Dec. 30, 2018, 6:36 p.m. OK FPC TESTS 30 62 27852800 1700
47773535 MYNAMEISSHARIFUL D Dec. 31, 2018, 1:03 a.m. OK GNU C11 TESTS 30 31 0 1700
48019578 luogu_bot4 D Jan. 6, 2019, 4:14 a.m. OK GNU C11 TESTS 30 31 8806400 1700
47892677 Potassium_ D Jan. 4, 2019, 7:56 a.m. OK GNU C11 TESTS 30 31 8806400 1700
47889222 seedkin D Jan. 4, 2019, 4:32 a.m. OK GNU C11 TESTS 30 46 0 1700
47751654 c-and-j D Dec. 30, 2018, 3:45 p.m. OK GNU C11 TESTS 30 46 0 1700
47755663 Sempr D Dec. 30, 2018, 4:08 p.m. OK GNU C11 TESTS 30 46 0 1700
47755844 preet_t D Dec. 30, 2018, 4:09 p.m. OK GNU C11 TESTS 30 46 0 1700
47752900 Chipe1 D Dec. 30, 2018, 3:52 p.m. OK GNU C11 TESTS 30 46 7987200 1700
48552900 dhuacm4 D Jan. 19, 2019, 3:15 a.m. OK GNU C11 TESTS 30 46 7987200 1700
47859935 MayankG D Jan. 3, 2019, 5:06 a.m. OK GNU C11 TESTS 30 61 7987200 1700
62422838 vjudge3 D Oct. 12, 2019, 1:26 p.m. OK GNU C++11 TESTS 30 31 0 1700
63089361 STORMGATE078 D Oct. 21, 2019, 5:47 p.m. OK GNU C++11 TESTS 30 31 0 1700
63957379 ce_amtic D Nov. 1, 2019, 2:51 a.m. OK GNU C++11 TESTS 30 31 0 1700
67864322 JiayinDeng D Dec. 29, 2019, 9:12 a.m. OK GNU C++11 TESTS 30 31 0 1700
58109367 StevenZhu D Aug. 1, 2019, 6:21 a.m. OK GNU C++11 TESTS 30 31 0 1700
56986868 Prof_BL D July 13, 2019, 4:11 p.m. OK GNU C++11 TESTS 30 31 0 1700
54986495 luc_ay_toi_da_yeu D June 2, 2019, 3:59 p.m. OK GNU C++11 TESTS 30 31 0 1700
59260798 dado612 D Aug. 22, 2019, 8:31 a.m. OK GNU C++11 TESTS 30 31 0 1700
58670301 waitpromisedflowerblooms D Aug. 12, 2019, 2:10 p.m. OK GNU C++11 TESTS 30 31 0 1700
57867641 lopare D July 27, 2019, 10:27 p.m. OK GNU C++11 TESTS 30 31 0 1700
47775841 radleyana14 D Dec. 31, 2018, 3:43 a.m. OK GNU C++14 TESTS 30 15 0 1700
47776319 ducluong D Dec. 31, 2018, 4:13 a.m. OK GNU C++14 TESTS 30 15 0 1700
48654524 ReaLNero1 D Jan. 21, 2019, 1:36 a.m. OK GNU C++14 TESTS 30 15 0 1700
47755809 coro65536 D Dec. 30, 2018, 4:09 p.m. OK GNU C++14 TESTS 30 30 0 1700
57474890 Menna-Allah05 Hossam._.Ali Khaled.Emad D July 21, 2019, 8:39 p.m. OK GNU C++14 TESTS 30 30 0 1700
47948471 Niladree_Datta D Jan. 4, 2019, 9:18 p.m. OK GNU C++14 TESTS 30 30 0 1700
47830484 Im_Amartya D Jan. 2, 2019, 6:14 a.m. OK GNU C++14 TESTS 30 30 0 1700
47811284 vladalos D Jan. 1, 2019, 11:30 a.m. OK GNU C++14 TESTS 30 30 7987200 1700
62671465 TriG0n0metry D Oct. 16, 2019, 9:55 a.m. OK GNU C++14 TESTS 30 31 0 1700
67788178 JaiLuthra77 D Dec. 28, 2019, 1:36 p.m. OK GNU C++14 TESTS 30 31 0 1700
47770752 yizhibaiwuya D Dec. 30, 2018, 8:55 p.m. OK GNU C++17 TESTS 30 30 0 1700
47768808 wongdark2017 D Dec. 30, 2018, 7:22 p.m. OK GNU C++17 TESTS 30 30 0 1700
47812510 armoking D Jan. 1, 2019, 12:19 p.m. OK GNU C++17 TESTS 30 30 0 1700
47819333 Rafiki53 D Jan. 1, 2019, 4:36 p.m. OK GNU C++17 TESTS 30 30 0 1700
67499315 racoon D Dec. 24, 2019, 3:03 a.m. OK GNU C++17 TESTS 30 31 0 1700
66992901 h__h D Dec. 15, 2019, 9:45 p.m. OK GNU C++17 TESTS 30 31 0 1700
63111135 Markuuus D Oct. 22, 2019, 7:30 a.m. OK GNU C++17 TESTS 30 31 0 1700
67788421 andrei_boaca D Dec. 28, 2019, 1:42 p.m. OK GNU C++17 TESTS 30 31 0 1700
67796728 lucas3h D Dec. 28, 2019, 4:59 p.m. OK GNU C++17 TESTS 30 31 0 1700
69391971 vjudge3 D Jan. 23, 2020, 4:13 a.m. OK GNU C++17 TESTS 30 31 0 1700
69229784 vjudge5 D Jan. 21, 2020, 9 a.m. OK Go TESTS 30 46 0 1700
69229704 synapse D Jan. 21, 2020, 8:58 a.m. OK Go TESTS 30 61 0 1700
64341948 MiohitoKiri5474 D Nov. 6, 2019, 3:26 a.m. OK Go TESTS 30 77 0 1700
47774572 gksato D Dec. 31, 2018, 2:25 a.m. OK Haskell TESTS 30 109 8499200 1700
47800677 gksato D Dec. 31, 2018, 10:20 p.m. OK Haskell TESTS 30 187 8499200 1700
47773036 gksato D Dec. 31, 2018, 12:11 a.m. OK Haskell TESTS 30 187 8499200 1700
47752585 haskell_brooks_curry D Dec. 30, 2018, 3:50 p.m. OK Haskell TESTS 30 202 8396800 1700
47807575 mihassan D Jan. 1, 2019, 8:30 a.m. OK Haskell TESTS 30 202 37990400 1700
51920645 sonowz D March 28, 2019, 4 a.m. OK Haskell TESTS 30 249 102400 1700
47760705 gksato D Dec. 30, 2018, 4:42 p.m. OK Haskell TESTS 30 249 8499200 1700
61942389 shaurya_singh D Oct. 5, 2019, 8:32 p.m. OK Java 8 TESTS 30 124 0 1700
51426423 tsumit023 D March 17, 2019, 7:31 p.m. OK Java 8 TESTS 30 124 0 1700
48547451 Pratik_Rajani D Jan. 18, 2019, 8:41 p.m. OK Java 8 TESTS 30 124 0 1700
47860224 bazinga84 D Jan. 3, 2019, 5:24 a.m. OK Java 8 TESTS 30 124 0 1700
47753942 Shaykhutdinov-T-I D Dec. 30, 2018, 3:58 p.m. OK Java 8 TESTS 30 124 0 1700
47750389 Dukkha D Dec. 30, 2018, 3:39 p.m. OK Java 8 TESTS 30 124 0 1700
61019549 Shady51 D Sept. 21, 2019, 2:14 p.m. OK Java 8 TESTS 30 139 0 1700
47748656 jebaited D Dec. 30, 2018, 3:31 p.m. OK Java 8 TESTS 30 139 0 1700
47762823 Faizan D Dec. 30, 2018, 4:57 p.m. OK Java 8 TESTS 30 139 15360000 1700
47753456 aman28rwt D Dec. 30, 2018, 3:55 p.m. OK Java 8 TESTS 30 139 15564800 1700
58081848 Spheniscine D July 31, 2019, 2:09 p.m. OK Kotlin TESTS 30 155 0 1700
47756360 zloi.timur D Dec. 30, 2018, 4:12 p.m. OK Kotlin TESTS 30 170 0 1700
58081449 Spheniscine D July 31, 2019, 2:02 p.m. OK Kotlin TESTS 30 186 0 1700
47750662 elizarov D Dec. 30, 2018, 3:41 p.m. OK Kotlin TESTS 30 186 3993600 1700
56255480 og.kostya D June 29, 2019, 5:56 a.m. OK Mono C# TESTS 30 77 0 1700
47753345 keymoon D Dec. 30, 2018, 3:54 p.m. OK Mono C# TESTS 30 77 0 1700
47757443 Coder_D D Dec. 30, 2018, 4:20 p.m. OK Mono C# TESTS 30 77 3891200 1700
47759758 omikad D Dec. 30, 2018, 4:36 p.m. OK Mono C# TESTS 30 77 7884800 1700
48300926 Anastasiya_Andreevna D Jan. 12, 2019, 4:52 p.m. OK Mono C# TESTS 30 93 0 1700
47750548 eki D Dec. 30, 2018, 3:40 p.m. OK Mono C# TESTS 30 109 16486400 1700
47901185 teru D Jan. 4, 2019, 2:15 p.m. OK Mono C# TESTS 30 109 16486400 1700
47753215 AnatolyTolstobrov D Dec. 30, 2018, 3:54 p.m. OK Mono C# TESTS 30 109 24883200 1700
47754624 claw88 D Dec. 30, 2018, 4:01 p.m. OK Mono C# TESTS 30 171 24678400 1700
47754298 mircea85 D Dec. 30, 2018, 3:59 p.m. OK Mono C# TESTS 30 295 16486400 1700
47804749 SamuelLim D Jan. 1, 2019, 5:57 a.m. OK MS C++ TESTS 30 31 0 1700
47821582 Gladius_Smerch D Jan. 1, 2019, 6:07 p.m. OK MS C++ TESTS 30 46 0 1700
47754017 dolboeb D Dec. 30, 2018, 3:58 p.m. OK MS C++ TESTS 30 46 0 1700
47766979 olya.masaeva D Dec. 30, 2018, 6:37 p.m. OK MS C++ TESTS 30 46 7987200 1700
54274869 vjudge3 D May 17, 2019, 10:39 a.m. OK MS C++ TESTS 30 61 0 1700
47752775 ast210 D Dec. 30, 2018, 3:51 p.m. OK MS C++ TESTS 30 62 0 1700
47753951 Ancient_mage D Dec. 30, 2018, 3:58 p.m. OK MS C++ TESTS 30 62 0 1700
47760499 youx D Dec. 30, 2018, 4:41 p.m. OK MS C++ TESTS 30 62 0 1700
47889446 wjfwjfwjf D Jan. 4, 2019, 4:49 a.m. OK MS C++ TESTS 30 62 0 1700
62072259 vjudge1 D Oct. 7, 2019, 5:06 p.m. OK MS C++ TESTS 30 62 7987200 1700
56232131 petko_mitkov D June 28, 2019, 2:39 p.m. OK MS C++ 2017 TESTS 30 46 0 1700
51361660 Heyhue D March 16, 2019, 7:36 a.m. OK MS C++ 2017 TESTS 30 46 7987200 1700
50570158 Kosmonaft D Feb. 27, 2019, 3:01 p.m. OK MS C++ 2017 TESTS 30 77 16076800 1700
53701595 AleksanderBalobanov D May 3, 2019, 10:49 a.m. OK MS C++ 2017 TESTS 30 577 7987200 1700
47768364 sk0 D Dec. 30, 2018, 7:08 p.m. OK Ocaml TESTS 30 326 44134400 1700
47797573 YESMAths D Dec. 31, 2018, 6:30 p.m. OK PyPy 2 TESTS 30 202 307200 1700
47753134 pajenegod D Dec. 30, 2018, 3:53 p.m. OK PyPy 2 TESTS 30 218 307200 1700
47755013 gedymin D Dec. 30, 2018, 4:04 p.m. OK PyPy 2 TESTS 30 233 0 1700
47761880 water D Dec. 30, 2018, 4:51 p.m. OK PyPy 2 TESTS 30 264 307200 1700
47751888 aeternalis1 D Dec. 30, 2018, 3:47 p.m. OK PyPy 2 TESTS 30 280 204800 1700
47750980 MathisHammel D Dec. 30, 2018, 3:42 p.m. OK PyPy 2 TESTS 30 280 204800 1700
47769060 tastymath75025 D Dec. 30, 2018, 7:32 p.m. OK PyPy 2 TESTS 30 436 61132800 1700
47762453 vinuthegr8 D Dec. 30, 2018, 4:54 p.m. OK PyPy 2 TESTS 30 467 61849600 1700
47754238 wangkan2001 D Dec. 30, 2018, 3:59 p.m. OK PyPy 2 TESTS 30 468 60518400 1700
47861553 tastymath75025 D Jan. 3, 2019, 6:26 a.m. OK PyPy 2 TESTS 30 498 61132800 1700
53495901 nthoang D April 29, 2019, 11:45 a.m. OK PyPy 3 TESTS 30 156 0 1700
47862118 whatshisbucket D Jan. 3, 2019, 6:56 a.m. OK PyPy 3 TESTS 30 170 0 1700
47862134 whatshisbucket D Jan. 3, 2019, 6:57 a.m. OK PyPy 3 TESTS 30 171 0 1700
47758647 justanothercoder D Dec. 30, 2018, 4:28 p.m. OK PyPy 3 TESTS 30 171 0 1700
47756440 0_kekker_0 D Dec. 30, 2018, 4:13 p.m. OK PyPy 3 TESTS 30 186 0 1700
47764206 yhn112 D Dec. 30, 2018, 5:05 p.m. OK PyPy 3 TESTS 30 187 102400 1700
47754209 mathdude42 D Dec. 30, 2018, 3:59 p.m. OK PyPy 3 TESTS 30 218 102400 1700
47895551 wadissimo D Jan. 4, 2019, 10:08 a.m. OK PyPy 3 TESTS 30 249 0 1700
65451313 UTMoonlight D Nov. 20, 2019, 6:14 p.m. OK PyPy 3 TESTS 30 249 1740800 1700
47779756 yellowflash D Dec. 31, 2018, 7:15 a.m. OK PyPy 3 TESTS 30 264 102400 1700
55703541 anshuman16423 D June 18, 2019, 6:18 a.m. OK Python 2 TESTS 30 514 16384000 1700
47965826 Hellia D Jan. 5, 2019, 12:05 p.m. OK Python 2 TESTS 30 514 16384000 1700
47788887 wunder9l D Dec. 31, 2018, 12:15 p.m. OK Python 2 TESTS 30 654 0 1700
47753565 Wizmann D Dec. 30, 2018, 3:55 p.m. OK Python 2 TESTS 30 748 16281600 1700
47861575 tastymath75025 D Jan. 3, 2019, 6:28 a.m. OK Python 2 TESTS 30 873 41779200 1700
47761849 aditya999123 D Dec. 30, 2018, 4:50 p.m. OK Python 2 TESTS 30 997 16384000 1700
47764619 alessandrosolbiati D Dec. 30, 2018, 5:08 p.m. OK Python 2 TESTS 30 1060 42086400 1700
47861639 tastymath75025 D Jan. 3, 2019, 6:30 a.m. OK Python 2 TESTS 30 1075 41779200 1700
48096369 ssk497 D Jan. 8, 2019, 5:06 p.m. OK Python 2 TESTS 30 1122 63283200 1700
47769751 kingmoshe D Dec. 30, 2018, 8:01 p.m. OK Python 2 TESTS 30 1622 58777600 1700
47776425 julianferres D Dec. 31, 2018, 4:20 a.m. OK Python 3 TESTS 30 358 0 1700
47767444 hitalia D Dec. 30, 2018, 6:46 p.m. OK Python 3 TESTS 30 373 0 1700
47790178 igorshepsh D Dec. 31, 2018, 12:55 p.m. OK Python 3 TESTS 30 389 0 1700
47779428 luogu_bot2 D Dec. 31, 2018, 7:01 a.m. OK Python 3 TESTS 30 404 0 1700
47861677 whatshisbucket D Jan. 3, 2019, 6:32 a.m. OK Python 3 TESTS 30 405 0 1700
47780384 riba2534 D Dec. 31, 2018, 7:42 a.m. OK Python 3 TESTS 30 405 0 1700
47779452 luogu_bot4 D Dec. 31, 2018, 7:03 a.m. OK Python 3 TESTS 30 405 0 1700
47774368 jlee D Dec. 31, 2018, 2:11 a.m. OK Python 3 TESTS 30 405 0 1700
47862526 MEJlAHXOJluK D Jan. 3, 2019, 7:17 a.m. OK Python 3 TESTS 30 421 0 1700
61425761 Kadtsin_vs D Sept. 28, 2019, 1:07 p.m. OK Python 3 TESTS 30 467 0 1700
47748418 alpha_virginis D Dec. 30, 2018, 3:30 p.m. OK Rust TESTS 30 124 25190400 1700
47780063 magnickolas D Dec. 31, 2018, 7:29 a.m. OK Scala TESTS 30 343 0 1700
47779500 magnickolas D Dec. 31, 2018, 7:05 a.m. OK Scala TESTS 30 436 0 1700
47779445 magnickolas D Dec. 31, 2018, 7:02 a.m. OK Scala TESTS 30 452 0 1700
47749673 limed D Dec. 30, 2018, 3:36 p.m. OK Scala TESTS 30 483 0 1700

remove filters

Back to search problems