April Fools Contest 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
952 April Fools Contest 2018 FINISHED False 7200 209226299 April 1, 2018, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2910 ) C Ravioli Sort PROGRAMMING implementation 1600

B'Everybody knows of spaghetti sort. You decided to implement an analog sorting algorithm yourself, but as you survey your pantry you realize you 're out of spaghetti! The only type of pasta you have is ravioli, but you are not going to let this stop you... You come up with the following algorithm. For each number in the array ai, build a stack of ai ravioli. The image shows the stack for ai xe2 x80 x89= xe2 x80 x894. Arrange the stacks in one row in the order in which the corresponding numbers appear in the input array. Find the tallest one (if there are several stacks of maximal height, use the leftmost one). Remove it and add its height to the end of the output array. Shift the stacks in the row so that there is no gap between them. Repeat the procedure until all stacks have been removed. At first you are very happy with your algorithm, but as you try it on more inputs you realize that it doesn 't always produce the right sorted array. Turns out when two stacks of ravioli are next to each other (at any step of the process) and differ in height by two or more, the top ravioli of the taller stack slides down on top of the lower stack. Given an input array, figure out whether the described algorithm will sort it correctly. The first line of input contains a single number n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8910) -- the size of the array. The second line of input contains n space-separated integers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100) -- the elements of the array. Output "YES" if the array can be sorted using the described procedure and "NO" if it can not. In the second example the array will change even before the tallest stack is chosen for the first time: ravioli from stack of height 3 will slide on the stack of height 1, and the algorithm will output an array {2, xe2 x80 x892, xe2 x80 x892}. '...

Tutorials

April Fools Day Contest 2018: editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
36874498 libra9z C April 2, 2018, 9:56 a.m. OK D TESTS 40 31 4300800 1600
36849202 ruban C April 1, 2018, 5:01 p.m. OK Delphi TESTS 40 30 10342400 1600
37025581 Ignatos C April 6, 2018, 3:58 p.m. OK FPC TESTS 40 31 3072000 1600
36882456 vodchitss C April 2, 2018, 3:25 p.m. OK FPC TESTS 40 31 3072000 1600
36850584 PAG C April 1, 2018, 5:05 p.m. OK FPC TESTS 40 31 3072000 1600
36838947 vassabbi C April 1, 2018, 4:38 p.m. OK FPC TESTS 40 31 3072000 1600
36830811 wchunhei C April 1, 2018, 4:23 p.m. OK FPC TESTS 40 31 3072000 1600
37479552 anabakhmat C April 20, 2018, 7:14 a.m. OK FPC TESTS 40 31 3072000 1600
37479461 anabakhmat C April 20, 2018, 7:09 a.m. OK FPC TESTS 40 31 3072000 1600
36894734 foysal_sarkar C April 3, 2018, 6:48 a.m. OK GNU C TESTS 40 15 3276800 1600
36865803 I_Love_U_Sohan C April 2, 2018, 12:34 a.m. OK GNU C TESTS 40 15 3276800 1600
36856163 fishybestgirl C April 1, 2018, 5:25 p.m. OK GNU C TESTS 40 15 3276800 1600
37041732 mdmomin C April 7, 2018, 7:29 a.m. OK GNU C TESTS 40 30 3276800 1600
36887792 egekabas C April 2, 2018, 7:35 p.m. OK GNU C TESTS 40 30 3276800 1600
36841047 manu_iam C April 1, 2018, 4:42 p.m. OK GNU C TESTS 40 30 3276800 1600
36886470 mahim-gray C April 2, 2018, 6:25 p.m. OK GNU C TESTS 40 30 3379200 1600
36893079 tanvir2parvej C April 3, 2018, 4:59 a.m. OK GNU C TESTS 40 30 3379200 1600
36895797 SinPodrugi C April 3, 2018, 7:49 a.m. OK GNU C TESTS 40 31 3276800 1600
36845287 rainboy C April 1, 2018, 4:52 p.m. OK GNU C TESTS 40 31 3276800 1600
37049180 freshman0213 C April 7, 2018, 12:05 p.m. OK GNU C++ TESTS 40 15 3276800 1600
36851457 Darth_YARIK_WEIDER C April 1, 2018, 5:08 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36847728 Mamad_Bombi C April 1, 2018, 4:58 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36835788 themadprogramer C April 1, 2018, 4:31 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36833181 hromov.igor C April 1, 2018, 4:27 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36829722 bbebee C April 1, 2018, 4:21 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36834897 tolja C April 1, 2018, 4:30 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36862228 Sajjad1603105 C April 1, 2018, 7:26 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36853726 Igor_1 C April 1, 2018, 5:16 p.m. OK GNU C++ TESTS 40 15 3481600 1600
36995520 vjudge2 C April 5, 2018, 11:18 a.m. OK GNU C++ TESTS 40 30 3276800 1600
36860287 andrianzju C April 1, 2018, 6:22 p.m. OK GNU C11 TESTS 40 30 3276800 1600
36859690 Nahid_Nayon C April 1, 2018, 6:06 p.m. OK GNU C11 TESTS 40 30 3379200 1600
52065929 akash19jain C March 31, 2019, 5:24 a.m. OK GNU C11 TESTS 40 31 0 1600
45035081 vjudge3 C Oct. 29, 2018, 7:10 a.m. OK GNU C++11 TESTS 40 15 0 1600
36835185 VisJiao C April 1, 2018, 4:30 p.m. OK GNU C++11 TESTS 40 15 3276800 1600
36840950 ethening C April 1, 2018, 4:42 p.m. OK GNU C++11 TESTS 40 15 3276800 1600
36831797 tomaso C April 1, 2018, 4:24 p.m. OK GNU C++11 TESTS 40 15 3276800 1600
36830210 Icyfox C April 1, 2018, 4:22 p.m. OK GNU C++11 TESTS 40 15 3379200 1600
36837402 Anton_Vak C April 1, 2018, 4:34 p.m. OK GNU C++11 TESTS 40 15 3379200 1600
36876635 DennisPraet C April 2, 2018, 11:40 a.m. OK GNU C++11 TESTS 40 15 3481600 1600
36906745 MMAA C April 3, 2018, 3:43 p.m. OK GNU C++11 TESTS 40 15 3481600 1600
36900338 huangda C April 3, 2018, 11:17 a.m. OK GNU C++11 TESTS 40 15 3481600 1600
36949439 nupt_ant C April 4, 2018, 12:40 p.m. OK GNU C++11 TESTS 40 15 3481600 1600
40090142 des1997 C July 8, 2018, 4:17 p.m. OK GNU C++14 TESTS 40 15 0 1600
39643797 code_name123 C June 25, 2018, 8:52 a.m. OK GNU C++14 TESTS 40 15 0 1600
39434887 Sagar288 C June 20, 2018, 11:54 a.m. OK GNU C++14 TESTS 40 15 0 1600
39278869 Toxin C June 16, 2018, 4:35 a.m. OK GNU C++14 TESTS 40 15 0 1600
39213874 hardiked C June 13, 2018, 11:01 a.m. OK GNU C++14 TESTS 40 15 0 1600
52147347 i_satyavrat C April 1, 2019, 10:04 a.m. OK GNU C++14 TESTS 40 15 0 1600
50338836 avid_avi C Feb. 22, 2019, 11:54 p.m. OK GNU C++14 TESTS 40 15 0 1600
60136079 ss6364 C Sept. 5, 2019, 6:18 p.m. OK GNU C++14 TESTS 40 15 0 1600
38911636 rishup132 C June 3, 2018, 6:35 a.m. OK GNU C++14 TESTS 40 15 3379200 1600
38249049 Arrias C May 14, 2018, 7:56 p.m. OK GNU C++14 TESTS 40 15 3379200 1600
56499517 spop C July 4, 2019, 5:35 a.m. OK GNU C++17 TESTS 40 15 0 1600
39144366 stArliGht C June 11, 2018, 11:21 a.m. OK GNU C++17 TESTS 40 15 0 1600
52142359 Iplayer C April 1, 2019, 7:31 a.m. OK GNU C++17 TESTS 40 15 819200 1600
36894595 ArianB C April 3, 2018, 6:40 a.m. OK GNU C++17 TESTS 40 15 3379200 1600
36868093 isChase C April 2, 2018, 4:26 a.m. OK GNU C++17 TESTS 40 15 3379200 1600
36856259 ikefir C April 1, 2018, 5:25 p.m. OK GNU C++17 TESTS 40 15 3379200 1600
36852041 DitesV C April 1, 2018, 5:10 p.m. OK GNU C++17 TESTS 40 15 3379200 1600
37185071 Hope_amasser C April 11, 2018, 2:54 a.m. OK GNU C++17 TESTS 40 15 3379200 1600
37895687 dhano.krishna123 C May 5, 2018, 4:22 a.m. OK GNU C++17 TESTS 40 15 3379200 1600
37104963 corelof C April 8, 2018, 4:46 p.m. OK GNU C++17 TESTS 40 15 3379200 1600
37104719 tianlongtc C April 8, 2018, 4:34 p.m. OK Go TESTS 40 31 24371200 1600
36842596 karoyakani C April 1, 2018, 4:45 p.m. OK Haskell TESTS 40 30 44953600 1600
46720495 kusomushi C Dec. 7, 2018, 1 p.m. OK Java 8 TESTS 40 109 0 1600
56233606 prem_cse C June 28, 2019, 3:13 p.m. OK Java 8 TESTS 40 109 0 1600
68113615 lebaur C Jan. 3, 2020, 10:33 a.m. OK Java 8 TESTS 40 109 0 1600
45472807 vjudge3 C Nov. 9, 2018, 10:52 a.m. OK Java 8 TESTS 40 124 0 1600
39234450 sooraj10 C June 14, 2018, 7:34 a.m. OK Java 8 TESTS 40 124 0 1600
51988533 PrakharJain C March 29, 2019, 6:41 p.m. OK Java 8 TESTS 40 124 0 1600
50338740 vjudge1 C Feb. 22, 2019, 11:46 p.m. OK Java 8 TESTS 40 124 0 1600
45511412 vjudge4 C Nov. 10, 2018, 1:13 p.m. OK Java 8 TESTS 40 124 0 1600
36856752 Vikuk C April 1, 2018, 5:27 p.m. OK Java 8 TESTS 40 124 20582400 1600
36875882 Cymbals C April 2, 2018, 11:06 a.m. OK Java 8 TESTS 40 124 20684800 1600
36845212 ko_osaga C April 1, 2018, 4:52 p.m. OK Kotlin TESTS 40 155 21094400 1600
36856995 focuspoint C April 1, 2018, 5:28 p.m. OK Kotlin TESTS 40 202 22937600 1600
36831298 nikitap3cd C April 1, 2018, 4:23 p.m. OK Mono C# TESTS 40 46 7884800 1600
36849297 Hadezkos C April 1, 2018, 5:02 p.m. OK Mono C# TESTS 40 46 11468800 1600
36838651 azukun C April 1, 2018, 4:37 p.m. OK Mono C# TESTS 40 61 11571200 1600
36851484 Pasha_Eagle C April 1, 2018, 5:08 p.m. OK MS C++ TESTS 40 15 3481600 1600
37143670 wuqi C April 10, 2018, 12:14 p.m. OK MS C++ TESTS 40 15 3481600 1600
37089274 Victor02 C April 8, 2018, 6:37 a.m. OK MS C++ TESTS 40 15 3481600 1600
36899823 Kosmonaft C April 3, 2018, 10:54 a.m. OK MS C++ TESTS 40 15 3481600 1600
36844864 smm1234 C April 1, 2018, 4:51 p.m. OK MS C++ TESTS 40 15 3481600 1600
36840428 ksercs C April 1, 2018, 4:41 p.m. OK MS C++ TESTS 40 15 3481600 1600
36835670 mustanggtr C April 1, 2018, 4:31 p.m. OK MS C++ TESTS 40 15 3481600 1600
37230250 Anton12436 C April 11, 2018, 4:42 p.m. OK MS C++ TESTS 40 15 3788800 1600
36847275 timtimX C April 1, 2018, 4:57 p.m. OK MS C++ TESTS 40 30 3481600 1600
36844893 Excimer C April 1, 2018, 4:51 p.m. OK MS C++ TESTS 40 30 3481600 1600
61611264 DanilM C Oct. 1, 2019, 2:11 p.m. OK MS C++ 2017 TESTS 40 31 0 1600
52080101 igor_rukhovich C March 31, 2019, 11:50 a.m. OK MS C++ 2017 TESTS 40 31 0 1600
36839840 Saroupille C April 1, 2018, 4:39 p.m. OK Ocaml TESTS 40 15 3891200 1600
36855679 Timofey2001 C April 1, 2018, 5:22 p.m. OK PascalABC.NET TESTS 40 46 17510400 1600
69513962 papayiv C Jan. 25, 2020, 11:22 a.m. OK PascalABC.NET TESTS 40 296 512000 1600
46255630 mayakin C Nov. 26, 2018, 4:32 p.m. OK PHP TESTS 40 31 512000 1600
36843052 ARMACOTY C April 1, 2018, 4:46 p.m. OK PyPy 3 TESTS 40 108 21401600 1600
36946796 AdMiRaLL C April 4, 2018, 10:54 a.m. OK PyPy 3 TESTS 40 109 21401600 1600
36882358 Surana C April 2, 2018, 3:21 p.m. OK PyPy 3 TESTS 40 109 21401600 1600
36848892 LordVoldebug C April 1, 2018, 5:01 p.m. OK PyPy 3 TESTS 40 109 21401600 1600
52144719 jeshrz C April 1, 2019, 8:44 a.m. OK PyPy 3 TESTS 40 124 0 1600
52137754 zhaoy1ping C April 1, 2019, 4:30 a.m. OK PyPy 3 TESTS 40 139 0 1600
40812294 lifefeeder C July 26, 2018, 5:34 p.m. OK PyPy 3 TESTS 40 140 0 1600
64526184 O_Ramanujan C Nov. 8, 2019, 1:52 p.m. OK PyPy 3 TESTS 40 171 0 1600
37453311 zyr17 C April 19, 2018, 6:15 a.m. OK Python 2 TESTS 40 93 6041600 1600
36841105 kribesk C April 1, 2018, 4:42 p.m. OK Python 2 TESTS 40 93 6041600 1600
36899549 atzaruri C April 3, 2018, 10:43 a.m. OK Python 2 TESTS 40 108 6041600 1600
36905053 laoliumang C April 3, 2018, 2:21 p.m. OK Python 2 TESTS 40 108 6144000 1600
39349850 tanghao C June 18, 2018, 7:37 a.m. OK Python 2 TESTS 40 109 0 1600
39208102 Ali_Pi C June 13, 2018, 6:46 a.m. OK Python 2 TESTS 40 109 0 1600
37532228 frostn C April 22, 2018, 11:44 a.m. OK Python 2 TESTS 40 109 6041600 1600
37091659 pelliot dauriac C April 8, 2018, 8:39 a.m. OK Python 2 TESTS 40 109 6041600 1600
36877385 nwi C April 2, 2018, 12:11 p.m. OK Python 2 TESTS 40 109 6041600 1600
36860143 EoinDavey C April 1, 2018, 6:18 p.m. OK Python 2 TESTS 40 109 6041600 1600
36950041 e666666 C April 4, 2018, 1:01 p.m. OK Python 3 TESTS 40 77 7065600 1600
36904775 Bamal C April 3, 2018, 2:08 p.m. OK Python 3 TESTS 40 77 7065600 1600
36855377 mAlex C April 1, 2018, 5:21 p.m. OK Python 3 TESTS 40 77 7065600 1600
36849026 BringerOfRain C April 1, 2018, 5:01 p.m. OK Python 3 TESTS 40 77 7065600 1600
36829892 rjkz2792009 C April 1, 2018, 4:21 p.m. OK Python 3 TESTS 40 77 7065600 1600
36829512 sekuu C April 1, 2018, 4:21 p.m. OK Python 3 TESTS 40 77 7065600 1600
37122181 Legendaddy C April 9, 2018, 12:53 p.m. OK Python 3 TESTS 40 78 7065600 1600
36905855 Cuellius C April 3, 2018, 2:58 p.m. OK Python 3 TESTS 40 78 7065600 1600
36896890 Yukimai C April 3, 2018, 8:49 a.m. OK Python 3 TESTS 40 78 7065600 1600
36882586 uhu C April 2, 2018, 3:31 p.m. OK Python 3 TESTS 40 78 7065600 1600
36829361 NMouad21 C April 1, 2018, 4:20 p.m. OK Ruby TESTS 40 62 6451200 1600
36902984 cielavenir C April 3, 2018, 12:57 p.m. OK Ruby TESTS 40 108 6348800 1600
36835423 nieru C April 1, 2018, 4:31 p.m. OK Scala TESTS 40 607 40448000 1600

remove filters

Back to search problems