Hello 2020

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
1284 Hello 2020 FINISHED False 9000 153683699 Jan. 4, 2020, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8089 ) C New Year and Permutation PROGRAMMING combinatorics math 1700

B'Recall that the permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array) and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). A sequence a is a subsegment of a sequence b if a can be obtained from b by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. We will denote the subsegments as [l, r] , where l, r are two integers with 1 <= l <= r <= n . This indicates the subsegment where l-1 elements from the beginning and n-r elements from the end are deleted from the sequence. For a permutation p_1, p_2, ldots, p_n , we define a framed segment as a subsegment [l,r] where max {p_l, p_{l+1}, ... , p_r } - min {p_l, p_{l+1}, ... , p_r } = r - l . For example, for the permutation (6, 7, 1, 8, 5, 3, 2, 4) some of its framed segments are: [1, 2], [5, 8], [6, 7], [3, 3], [8, 8] . In particular, a subsegment [i,i] is always a framed segments for any i between 1 and n , inclusive. We define the happiness of a permutation p as the number of pairs (l, r) such that 1 <= l <= r <= n , and [l, r] is a framed segment. For example, the permutation [3, 1, 2] has happiness 5 : all segments except [1, 2] are framed segments. Given integers n and m , Jongwon wants to compute the sum of happiness for all permutations of length n , modulo the prime number m . Note that there exist n! (factorial of n ) different permutations of length n . The only line contains two integers n and m ( 1 <= n <= 250 ,000 , 10^8 <= m <= 10^9 , m is prime). Print r ( 0 <= r < m ), the sum'...

Tutorials

Hello 2020 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
68178149 Gassa C Jan. 4, 2020, 12:47 p.m. OK D TESTS 40 46 0 1700
68166803 hos.lyric C Jan. 4, 2020, 12:11 p.m. OK D TESTS 40 46 4198400 1700
68179148 iica C Jan. 4, 2020, 12:52 p.m. OK D TESTS 40 124 4300800 1700
68202463 ruban C Jan. 4, 2020, 4:27 p.m. OK Delphi TESTS 40 265 195174400 1700
68867254 canhtoantpvp C Jan. 15, 2020, 1:58 p.m. OK FPC TESTS 40 31 2048000 1700
68867436 canhtoantpvp C Jan. 15, 2020, 2:01 p.m. OK FPC TESTS 40 46 2048000 1700
68409459 ananaygupta70 C Jan. 8, 2020, 4:26 p.m. OK GNU C11 TESTS 40 31 2048000 1700
69057352 kaname_madoka123 C Jan. 18, 2020, 3:01 p.m. OK GNU C11 TESTS 40 31 2048000 1700
68218327 YOK C Jan. 5, 2020, 2:26 a.m. OK GNU C11 TESTS 40 46 2048000 1700
68182454 _Rebellion C Jan. 4, 2020, 1:07 p.m. OK GNU C11 TESTS 40 46 2048000 1700
68174481 physics0523 C Jan. 4, 2020, 12:31 p.m. OK GNU C11 TESTS 40 62 8396800 1700
68345752 lalithya1211 C Jan. 7, 2020, 7:07 a.m. OK GNU C11 TESTS 40 77 19968000 1700
68180745 pengin_2000 C Jan. 4, 2020, 12:59 p.m. OK GNU C11 TESTS 40 78 19968000 1700
68178642 Rainybunny C Jan. 4, 2020, 12:49 p.m. OK GNU C++11 TESTS 40 31 819200 1700
68177565 asdfghjk C Jan. 4, 2020, 12:44 p.m. OK GNU C++11 TESTS 40 31 819200 1700
68228437 georgerapeanu C Jan. 5, 2020, 8:11 a.m. OK GNU C++11 TESTS 40 31 819200 1700
68219610 _CONSTautomaton C Jan. 5, 2020, 3:37 a.m. OK GNU C++11 TESTS 40 31 819200 1700
68188112 crashed C Jan. 4, 2020, 1:37 p.m. OK GNU C++11 TESTS 40 31 819200 1700
68182115 sunshine_chen C Jan. 4, 2020, 1:06 p.m. OK GNU C++11 TESTS 40 31 819200 1700
68180383 kkktl01 C Jan. 4, 2020, 12:57 p.m. OK GNU C++11 TESTS 40 31 819200 1700
69280651 luogu_bot2 C Jan. 22, 2020, 5:43 a.m. OK GNU C++11 TESTS 40 31 819200 1700
68236649 SOSCHINA C Jan. 5, 2020, 11:13 a.m. OK GNU C++11 TESTS 40 31 819200 1700
68174487 142857 C Jan. 4, 2020, 12:31 p.m. OK GNU C++11 TESTS 40 31 921600 1700
68194589 abj02 C Jan. 4, 2020, 2:13 p.m. OK GNU C++14 TESTS 40 30 1945600 1700
68693853 9lie C Jan. 13, 2020, 7:13 a.m. OK GNU C++14 TESTS 40 30 2048000 1700
68213837 rath772k C Jan. 4, 2020, 9:06 p.m. OK GNU C++14 TESTS 40 30 2048000 1700
68206053 zeus_iitg C Jan. 4, 2020, 5:26 p.m. OK GNU C++14 TESTS 40 30 2048000 1700
68945345 DarkFloyd C Jan. 16, 2020, 3:56 p.m. OK GNU C++14 TESTS 40 30 2457600 1700
68996978 alwaysF C Jan. 17, 2020, 5:48 p.m. OK GNU C++14 TESTS 40 31 1024000 1700
68978296 Scut82 C Jan. 17, 2020, 9:43 a.m. OK GNU C++14 TESTS 40 31 1024000 1700
68974590 Scut82 C Jan. 17, 2020, 8:20 a.m. OK GNU C++14 TESTS 40 31 1024000 1700
68939238 MegaOwIer C Jan. 16, 2020, 1:52 p.m. OK GNU C++14 TESTS 40 31 1024000 1700
69504547 kayush C Jan. 25, 2020, 8 a.m. OK GNU C++14 TESTS 40 31 1024000 1700
69179841 anakib1 C Jan. 20, 2020, 9:37 a.m. OK GNU C++17 TESTS 40 15 2048000 1700
68218179 abdulrahman_aj C Jan. 5, 2020, 2:18 a.m. OK GNU C++17 TESTS 40 30 1024000 1700
69110432 nNguyeNn C Jan. 19, 2020, 1:57 p.m. OK GNU C++17 TESTS 40 30 1945600 1700
68222551 dixitgarg C Jan. 5, 2020, 5:38 a.m. OK GNU C++17 TESTS 40 30 1945600 1700
68479275 qiaoza666 C Jan. 10, 2020, 7:02 a.m. OK GNU C++17 TESTS 40 30 2048000 1700
68243085 Karpit_Patel C Jan. 5, 2020, 1:31 p.m. OK GNU C++17 TESTS 40 30 2048000 1700
68237539 shoaib98libra C Jan. 5, 2020, 11:32 a.m. OK GNU C++17 TESTS 40 30 2048000 1700
68223021 1234erasyl C Jan. 5, 2020, 5:53 a.m. OK GNU C++17 TESTS 40 30 2048000 1700
68191738 Laizl C Jan. 4, 2020, 1:57 p.m. OK GNU C++17 TESTS 40 31 0 1700
69458768 Tudor_Voicu C Jan. 24, 2020, 9:46 a.m. OK GNU C++17 TESTS 40 31 1024000 1700
68238857 insert_cool_handle C Jan. 5, 2020, 12:03 p.m. OK Java 11 TESTS 40 186 614400 1700
68178584 potatmen C Jan. 4, 2020, 12:49 p.m. OK Java 11 TESTS 40 187 512000 1700
68215447 thisSideAnonymous C Jan. 4, 2020, 10:37 p.m. OK Java 11 TESTS 40 187 512000 1700
68186520 machhra C Jan. 4, 2020, 1:28 p.m. OK Java 11 TESTS 40 187 512000 1700
68184872 barakraganosungam C Jan. 4, 2020, 1:20 p.m. OK Java 11 TESTS 40 187 4710400 1700
68175055 mikit C Jan. 4, 2020, 12:33 p.m. OK Java 11 TESTS 40 202 512000 1700
69437214 jakejase2 C Jan. 23, 2020, 7:31 p.m. OK Java 11 TESTS 40 202 512000 1700
68380356 TheSawan C Jan. 8, 2020, 12:07 a.m. OK Java 11 TESTS 40 202 512000 1700
68194704 pikapika00 C Jan. 4, 2020, 2:14 p.m. OK Java 11 TESTS 40 202 512000 1700
68191203 zhanyi_xiaolu C Jan. 4, 2020, 1:54 p.m. OK Java 11 TESTS 40 202 512000 1700
68239397 luchy0120 C Jan. 5, 2020, 12:14 p.m. OK Java 8 TESTS 40 124 0 1700
68862587 arsh1598 C Jan. 15, 2020, 12:33 p.m. OK Java 8 TESTS 40 124 0 1700
68608862 alibaba C Jan. 11, 2020, 2:58 p.m. OK Java 8 TESTS 40 124 0 1700
68416024 adarsh000321 C Jan. 8, 2020, 6:56 p.m. OK Java 8 TESTS 40 124 0 1700
68377727 mareshkau C Jan. 7, 2020, 9:06 p.m. OK Java 8 TESTS 40 124 0 1700
68353251 Baroudy C Jan. 7, 2020, 10:53 a.m. OK Java 8 TESTS 40 124 0 1700
68351885 an09mous C Jan. 7, 2020, 10:15 a.m. OK Java 8 TESTS 40 124 0 1700
68334325 e_is_cool C Jan. 6, 2020, 8:34 p.m. OK Java 8 TESTS 40 124 0 1700
68229487 MartyByrde C Jan. 5, 2020, 8:38 a.m. OK Java 8 TESTS 40 124 0 1700
68221657 Faizan C Jan. 5, 2020, 5:09 a.m. OK Java 8 TESTS 40 124 0 1700
68408502 godxpunk C Jan. 8, 2020, 3:59 p.m. OK Kotlin TESTS 40 140 1024000 1700
68233571 seirion C Jan. 5, 2020, 10:06 a.m. OK Kotlin TESTS 40 155 1638400 1700
68296955 Spheniscine C Jan. 6, 2020, 3:39 a.m. OK Kotlin TESTS 40 155 2048000 1700
68177984 knightL C Jan. 4, 2020, 12:46 p.m. OK Kotlin TESTS 40 171 1638400 1700
68170974 Tlatoani C Jan. 4, 2020, 12:20 p.m. OK Kotlin TESTS 40 202 3686400 1700
68319467 V.Gladin C Jan. 6, 2020, 2:25 p.m. OK Mono C# TESTS 40 62 1945600 1700
68170346 EmK C Jan. 4, 2020, 12:18 p.m. OK Mono C# TESTS 40 77 3481600 1700
68176733 keymoon C Jan. 4, 2020, 12:41 p.m. OK Mono C# TESTS 40 77 7782400 1700
68187533 DM7PvTyc C Jan. 4, 2020, 1:34 p.m. OK Mono C# TESTS 40 78 1945600 1700
68227305 plasma-effect C Jan. 5, 2020, 7:41 a.m. OK Mono C# TESTS 40 78 5529600 1700
68188752 mban259 C Jan. 4, 2020, 1:40 p.m. OK Mono C# TESTS 40 78 7884800 1700
68190106 sergmel C Jan. 4, 2020, 1:48 p.m. OK Mono C# TESTS 40 93 7577600 1700
68182701 hibatibati C Jan. 4, 2020, 1:09 p.m. OK Mono C# TESTS 40 108 7475200 1700
68205182 Yupiteru C Jan. 4, 2020, 5:09 p.m. OK Mono C# TESTS 40 108 140288000 1700
68183801 Yupiteru C Jan. 4, 2020, 1:14 p.m. OK Mono C# TESTS 40 109 138035200 1700
68769453 vjudge2 C Jan. 14, 2020, 11:18 a.m. OK MS C++ TESTS 40 31 2048000 1700
68970214 vjudge4 C Jan. 17, 2020, 6:42 a.m. OK MS C++ TESTS 40 31 7987200 1700
68176002 wa1tz719 C Jan. 4, 2020, 12:37 p.m. OK MS C++ TESTS 40 46 1024000 1700
68768826 vjudge3 C Jan. 14, 2020, 11:02 a.m. OK MS C++ TESTS 40 46 2048000 1700
68185568 Dixtosa C Jan. 4, 2020, 1:23 p.m. OK MS C++ TESTS 40 46 2048000 1700
68769987 vjudge4 C Jan. 14, 2020, 11:29 a.m. OK MS C++ TESTS 40 46 2048000 1700
68176962 math957963 C Jan. 4, 2020, 12:42 p.m. OK MS C++ TESTS 40 46 2355200 1700
68219809 HerbertHan C Jan. 5, 2020, 3:47 a.m. OK MS C++ TESTS 40 46 2457600 1700
68769348 vjudge4 C Jan. 14, 2020, 11:16 a.m. OK MS C++ TESTS 40 46 2457600 1700
68179185 tarattata1 C Jan. 4, 2020, 12:52 p.m. OK MS C++ TESTS 40 390 4812800 1700
68491602 jjongwuner C Jan. 10, 2020, 11:54 a.m. OK MS C++ 2017 TESTS 40 31 2048000 1700
68608676 varsha_18524 C Jan. 11, 2020, 2:55 p.m. OK MS C++ 2017 TESTS 40 31 2048000 1700
68642124 18wh1a0546 C Jan. 12, 2020, 7:51 a.m. OK MS C++ 2017 TESTS 40 31 2048000 1700
68185721 P___ C Jan. 4, 2020, 1:24 p.m. OK MS C++ 2017 TESTS 40 46 1024000 1700
68184204 Sem_1337 C Jan. 4, 2020, 1:16 p.m. OK MS C++ 2017 TESTS 40 46 1024000 1700
68198718 CygneNoir C Jan. 4, 2020, 2:33 p.m. OK MS C++ 2017 TESTS 40 46 2048000 1700
68202519 Tangerine C Jan. 4, 2020, 4:28 p.m. OK MS C++ 2017 TESTS 40 46 2048000 1700
68203119 youx C Jan. 4, 2020, 4:36 p.m. OK MS C++ 2017 TESTS 40 46 2048000 1700
68308761 klswkkj C Jan. 6, 2020, 10:12 a.m. OK MS C++ 2017 TESTS 40 46 2048000 1700
68659624 sudha_18501 C Jan. 12, 2020, 1:14 p.m. OK MS C++ 2017 TESTS 40 46 2048000 1700
68180523 MVP C Jan. 4, 2020, 12:58 p.m. OK PyPy 2 TESTS 40 202 16076800 1700
68179977 _kawaii_neko_ C Jan. 4, 2020, 12:55 p.m. OK PyPy 2 TESTS 40 202 16179200 1700
68188682 TheManTheMythTheLegend C Jan. 4, 2020, 1:40 p.m. OK PyPy 2 TESTS 40 202 16384000 1700
68195200 SoSooding C Jan. 4, 2020, 2:16 p.m. OK PyPy 2 TESTS 40 202 16793600 1700
68343269 aaa_bbb_ccc C Jan. 7, 2020, 5:35 a.m. OK PyPy 2 TESTS 40 217 16793600 1700
68342843 aaa_bbb_ccc C Jan. 7, 2020, 5:15 a.m. OK PyPy 2 TESTS 40 218 16076800 1700
68180257 Eae02 C Jan. 4, 2020, 12:57 p.m. OK PyPy 2 TESTS 40 218 16076800 1700
68188683 Kevin_Tang C Jan. 4, 2020, 1:40 p.m. OK PyPy 2 TESTS 40 233 16588800 1700
68400227 anshuman16423 C Jan. 8, 2020, 12:53 p.m. OK PyPy 2 TESTS 40 264 16076800 1700
68343225 aaa_bbb_ccc C Jan. 7, 2020, 5:33 a.m. OK PyPy 2 TESTS 40 280 16793600 1700
68204937 FireBird23 C Jan. 4, 2020, 5:04 p.m. OK PyPy 3 TESTS 40 202 17920000 1700
68211736 sybergeek C Jan. 4, 2020, 7:43 p.m. OK PyPy 3 TESTS 40 202 17920000 1700
68218469 Apale C Jan. 5, 2020, 2:35 a.m. OK PyPy 3 TESTS 40 202 18124800 1700
68239648 xiema C Jan. 5, 2020, 12:19 p.m. OK PyPy 3 TESTS 40 202 23244800 1700
68186749 gusree C Jan. 4, 2020, 1:30 p.m. OK PyPy 3 TESTS 40 217 17203200 1700
68224611 yellowflash C Jan. 5, 2020, 6:35 a.m. OK PyPy 3 TESTS 40 217 18022400 1700
68191516 Paixao C Jan. 4, 2020, 1:56 p.m. OK PyPy 3 TESTS 40 217 18124800 1700
68205459 Waiting C Jan. 4, 2020, 5:14 p.m. OK PyPy 3 TESTS 40 218 16896000 1700
68203762 shiv_99 C Jan. 4, 2020, 4:45 p.m. OK PyPy 3 TESTS 40 218 17203200 1700
68188710 vinuthegr8 C Jan. 4, 2020, 1:40 p.m. OK PyPy 3 TESTS 40 218 17612800 1700
68184290 lijianghan C Jan. 4, 2020, 1:16 p.m. OK Python 2 TESTS 40 405 5324800 1700
68173649 nwi C Jan. 4, 2020, 12:28 p.m. OK Python 2 TESTS 40 421 5324800 1700
68189557 ChaosL C Jan. 4, 2020, 1:45 p.m. OK Python 2 TESTS 40 529 6246400 1700
68186412 ekali C Jan. 4, 2020, 1:28 p.m. OK Python 2 TESTS 40 670 6246400 1700
68194131 Throw_p C Jan. 4, 2020, 2:11 p.m. OK Python 3 TESTS 40 343 6860800 1700
68214329 FlyingBag65 C Jan. 4, 2020, 9:30 p.m. OK Python 3 TESTS 40 373 7577600 1700
68179875 IngaleAnkur10 C Jan. 4, 2020, 12:55 p.m. OK Python 3 TESTS 40 421 5222400 1700
68185582 Shee11 C Jan. 4, 2020, 1:23 p.m. OK Python 3 TESTS 40 421 6246400 1700
68624362 Muyuyi C Jan. 11, 2020, 8:42 p.m. OK Python 3 TESTS 40 421 7577600 1700
68762734 hahaha_iamhappy C Jan. 14, 2020, 8:47 a.m. OK Python 3 TESTS 40 436 5222400 1700
68234211 khaliq_almel C Jan. 5, 2020, 10:19 a.m. OK Python 3 TESTS 40 436 7577600 1700
68179420 Dart-Xeyter C Jan. 4, 2020, 12:53 p.m. OK Python 3 TESTS 40 436 7577600 1700
68178515 sotanishy C Jan. 4, 2020, 12:49 p.m. OK Python 3 TESTS 40 451 5222400 1700
68302327 wang639026 C Jan. 6, 2020, 7:19 a.m. OK Python 3 TESTS 40 451 6860800 1700
68441534 Lancern C Jan. 9, 2020, 11:07 a.m. OK Rust TESTS 40 46 1945600 1700
68181796 terraformer C Jan. 4, 2020, 1:04 p.m. OK Rust TESTS 40 46 1945600 1700
68177703 tuna_salad C Jan. 4, 2020, 12:45 p.m. OK Rust TESTS 40 46 1945600 1700
68179685 ichyo C Jan. 4, 2020, 12:54 p.m. OK Rust TESTS 40 46 2560000 1700
68218010 manta1130 C Jan. 5, 2020, 2:07 a.m. OK Rust TESTS 40 46 3174400 1700
68178314 limed C Jan. 4, 2020, 12:48 p.m. OK Scala TESTS 40 467 0 1700

remove filters

Back to search problems