Divide by Zero 2021 and Codeforces Round 714 (Div. 2)

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
1513 Divide by Zero 2021 and Codeforces Round 714 (Div. 2) FINISHED False 7200 119028263 April 11, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19496 ) A Array and Peaks PROGRAMMING constructive algorithms implementation

B'A sequence of n integers is called a permutation if it contains all integers from 1 to n exactly once. Given two integers n and k , construct a permutation a of numbers from 1 to n which has exactly k peaks. An index i of an array a of size n is said to be a peak if 1 < i < n and a_i gt a_{i-1} and a_i gt a_{i+1} . If such permutation is not possible, then print -1 . The first line contains an integer t ( 1 <= q t <= q 100 ) -- the number of test cases. Then t lines follow, each containing two space-separated integers n ( 1 <= q n <= q 100 ) and k ( 0 <= q k <= q n ) -- the length of an array and the required number of peaks. Output t lines. For each test case, if there is no permutation with given length and number of peaks, then print -1 . Otherwise print a line containing n space-separated integers which forms a permutation of numbers from 1 to n and contains exactly k peaks. If there are multiple answers, print any. In the second test case of the example, we have array a = [2,4,1,5,3] . Here, indices i=2 and i=4 are the peaks of the array. This is because (a_{2} gt a_{1} , a_{2} gt a_{3}) and (a_{4} gt a_{3} , a_{4} gt a_{5}) . '...

Tutorials

Divide by Zero 2021 and Codeforces Round #714 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
112708742 eastnman A April 11, 2021, 4:32 p.m. OK Delphi TESTS 9 31 102400
112741752 ducmanh161104 A April 12, 2021, 3:24 a.m. OK FPC TESTS 9 30 0
112706751 Suntrakanesh A April 11, 2021, 4:27 p.m. OK GNU C11 TESTS 9 31 0
112713803 Sanjay30 A April 11, 2021, 5:22 p.m. OK GNU C11 TESTS 9 31 0
112712371 20bcs030 A April 11, 2021, 5:12 p.m. OK GNU C11 TESTS 9 31 0
112711462 MVG_27 A April 11, 2021, 5:06 p.m. OK GNU C11 TESTS 9 31 0
112720459 ADITYA_17 A April 11, 2021, 6:43 p.m. OK GNU C11 TESTS 9 31 0
112746594 mrdgup_12 A April 12, 2021, 5:03 a.m. OK GNU C++11 TESTS 9 15 0
112749146 Chenfree A April 12, 2021, 5:43 a.m. OK GNU C++11 TESTS 9 15 0
112749131 zkdxl A April 12, 2021, 5:43 a.m. OK GNU C++11 TESTS 9 15 0
112748599 shoili A April 12, 2021, 5:35 a.m. OK GNU C++11 TESTS 9 15 0
112748391 ducle1701 A April 12, 2021, 5:32 a.m. OK GNU C++11 TESTS 9 15 0
112747828 20010816feng A April 12, 2021, 5:23 a.m. OK GNU C++11 TESTS 9 15 0
112747747 subhadeepdas2410 A April 12, 2021, 5:21 a.m. OK GNU C++11 TESTS 9 15 0
112747628 No_NHSPC_I_am_Garbage A April 12, 2021, 5:19 a.m. OK GNU C++11 TESTS 9 15 0
112749842 invisibleeee789 A April 12, 2021, 5:53 a.m. OK GNU C++11 TESTS 9 15 0
112749840 rak_2411 A April 12, 2021, 5:53 a.m. OK GNU C++11 TESTS 9 15 0
112749800 rajpal54 A April 12, 2021, 5:53 a.m. OK GNU C++14 TESTS 9 15 0
112749723 badalyadav A April 12, 2021, 5:52 a.m. OK GNU C++14 TESTS 9 15 0
112749717 sg_186 A April 12, 2021, 5:51 a.m. OK GNU C++14 TESTS 9 15 0
112749699 15Ishaan A April 12, 2021, 5:51 a.m. OK GNU C++14 TESTS 9 15 0
112748986 gaurav_kumar_dhama A April 12, 2021, 5:41 a.m. OK GNU C++14 TESTS 9 15 0
112748764 Ankit111 A April 12, 2021, 5:37 a.m. OK GNU C++14 TESTS 9 15 0
112750373 Puneet_dgreat A April 12, 2021, 6:02 a.m. OK GNU C++14 TESTS 9 15 0
112750598 S_Aditya A April 12, 2021, 6:05 a.m. OK GNU C++14 TESTS 9 15 0
112750354 dakshgarg A April 12, 2021, 6:01 a.m. OK GNU C++14 TESTS 9 15 0
112749898 ddixit398 A April 12, 2021, 5:54 a.m. OK GNU C++14 TESTS 9 15 0
112749555 200iq A April 12, 2021, 5:49 a.m. OK GNU C++17 TESTS 9 15 0
112750475 jieunie A April 12, 2021, 6:03 a.m. OK GNU C++17 TESTS 9 15 0
112750449 Chromefish A April 12, 2021, 6:03 a.m. OK GNU C++17 TESTS 9 15 0
112750027 Xhnxhn A April 12, 2021, 5:56 a.m. OK GNU C++17 TESTS 9 15 0
112749658 kojoker A April 12, 2021, 5:51 a.m. OK GNU C++17 TESTS 9 15 0
112749587 hovin A April 12, 2021, 5:50 a.m. OK GNU C++17 TESTS 9 15 0
112749411 Sultan-18 A April 12, 2021, 5:47 a.m. OK GNU C++17 TESTS 9 15 0
112749317 nav._.yea A April 12, 2021, 5:46 a.m. OK GNU C++17 TESTS 9 15 0
112748952 the_ancient_one_ A April 12, 2021, 5:40 a.m. OK GNU C++17 TESTS 9 15 0
112748898 chandrashekarvt A April 12, 2021, 5:39 a.m. OK GNU C++17 TESTS 9 15 0
112745627 raghhavdturki A April 12, 2021, 4:44 a.m. OK GNU C++17 (64) TESTS 9 15 0
112745532 HOLMES_2k A April 12, 2021, 4:43 a.m. OK GNU C++17 (64) TESTS 9 15 0
112745499 youtsuha A April 12, 2021, 4:42 a.m. OK GNU C++17 (64) TESTS 9 15 0
112744830 Diazones A April 12, 2021, 4:29 a.m. OK GNU C++17 (64) TESTS 9 15 0
112744303 Svlad_Cjelli A April 12, 2021, 4:19 a.m. OK GNU C++17 (64) TESTS 9 15 0
112743994 Bu1bu1 A April 12, 2021, 4:12 a.m. OK GNU C++17 (64) TESTS 9 15 0
112745917 Sagar_ A April 12, 2021, 4:50 a.m. OK GNU C++17 (64) TESTS 9 15 0
112746496 AkshitDh A April 12, 2021, 5:01 a.m. OK GNU C++17 (64) TESTS 9 15 0
112747191 prasanna2425 A April 12, 2021, 5:13 a.m. OK GNU C++17 (64) TESTS 9 15 0
112747775 tienthinh13022005 A April 12, 2021, 5:22 a.m. OK GNU C++17 (64) TESTS 9 15 0
112714108 ypa A April 11, 2021, 5:25 p.m. OK Java 11 TESTS 9 171 0
112724193 _merlin_ A April 11, 2021, 7:44 p.m. OK Java 11 TESTS 9 171 0
112730790 iamavalon A April 11, 2021, 11:06 p.m. OK Java 11 TESTS 9 187 0
112712355 arpit31 A April 11, 2021, 5:11 p.m. OK Java 11 TESTS 9 202 0
112739949 akashkumarkly A April 12, 2021, 2:36 a.m. OK Java 11 TESTS 9 202 0
112727020 tusharpruth A April 11, 2021, 8:45 p.m. OK Java 11 TESTS 9 202 0
112719172 dwivedivedbrat A April 11, 2021, 6:24 p.m. OK Java 11 TESTS 9 202 0
112727987 yudi23 A April 11, 2021, 9:11 p.m. OK Java 11 TESTS 9 218 0
112743853 vivek01 A April 12, 2021, 4:09 a.m. OK Java 11 TESTS 9 218 0
112740170 RainLiOfficial A April 12, 2021, 2:43 a.m. OK Java 11 TESTS 9 218 0
112718520 Abdallah_Ragab00 A April 11, 2021, 6:16 p.m. OK Java 8 TESTS 9 108 0
112711581 gssakash A April 11, 2021, 5:06 p.m. OK Java 8 TESTS 9 109 0
112750407 Prakrit18 A April 12, 2021, 6:02 a.m. OK Java 8 TESTS 9 109 0
112747089 Charigardash A April 12, 2021, 5:11 a.m. OK Java 8 TESTS 9 109 0
112744825 mohammadomar A April 12, 2021, 4:29 a.m. OK Java 8 TESTS 9 109 0
112726357 ZiadASadek A April 11, 2021, 8:29 p.m. OK Java 8 TESTS 9 109 0
112719358 nandit A April 11, 2021, 6:27 p.m. OK Java 8 TESTS 9 109 0
112716701 di_halt A April 11, 2021, 5:53 p.m. OK Java 8 TESTS 9 109 0
112711815 PRIYANSH_TOMAR A April 11, 2021, 5:08 p.m. OK Java 8 TESTS 9 109 0
112746127 gssakash A April 12, 2021, 4:54 a.m. OK Java 8 TESTS 9 124 0
112716864 TRR A April 11, 2021, 5:55 p.m. OK Mono C# TESTS 9 77 307200
112748766 05260219 A April 12, 2021, 5:37 a.m. OK MS C++ 2017 TESTS 9 15 0
112742682 WCmidschool A April 12, 2021, 3:45 a.m. OK MS C++ 2017 TESTS 9 15 0
112721443 Viktor36 A April 11, 2021, 6:57 p.m. OK MS C++ 2017 TESTS 9 15 0
112742569 Albertplus007 A April 12, 2021, 3:43 a.m. OK MS C++ 2017 TESTS 9 30 0
112705315 setuid0 A April 11, 2021, 4:22 p.m. OK MS C++ 2017 TESTS 9 30 0
112704053 Lone_coding A April 11, 2021, 4:18 p.m. OK MS C++ 2017 TESTS 9 30 307200
112713446 svr2kos2 A April 11, 2021, 5:19 p.m. OK MS C++ 2017 TESTS 9 31 0
112706706 bh27122000 A April 11, 2021, 4:27 p.m. OK MS C++ 2017 TESTS 9 31 0
112733225 sakapon A April 12, 2021, 1:10 a.m. OK .NET Core C# TESTS 9 93 512000
112704852 immadmohit A April 11, 2021, 4:21 p.m. OK PyPy 3 TESTS 9 93 1433600
112740179 phantomxxx A April 12, 2021, 2:43 a.m. OK PyPy 3 TESTS 9 93 3072000
112743587 amtn1212 A April 12, 2021, 4:04 a.m. OK PyPy 3 TESTS 9 108 1433600
112706664 sarthaksingh09 A April 11, 2021, 4:26 p.m. OK PyPy 3 TESTS 9 108 1433600
112704046 artgag06 A April 11, 2021, 4:18 p.m. OK PyPy 3 TESTS 9 108 1536000
112737022 rebel101 A April 12, 2021, 2:10 a.m. OK PyPy 3 TESTS 9 108 1638400
112743047 shajith_ham A April 12, 2021, 3:52 a.m. OK PyPy 3 TESTS 9 108 1740800
112702667 mahima2001 A April 11, 2021, 4:14 p.m. OK PyPy 3 TESTS 9 108 2150400
112711429 not_tehlka A April 11, 2021, 5:06 p.m. OK PyPy 3 TESTS 9 108 2457600
112744643 mohantyabhijit074 A April 12, 2021, 4:26 a.m. OK PyPy 3 TESTS 9 108 2560000
112737126 supraja872 A April 12, 2021, 2:14 a.m. OK Python 3 TESTS 9 46 0
112727193 nhan0510 A April 11, 2021, 8:50 p.m. OK Python 3 TESTS 9 46 0
112736914 hogrider A April 12, 2021, 2:06 a.m. OK Python 3 TESTS 9 61 0
112726603 satakshigarg A April 11, 2021, 8:35 p.m. OK Python 3 TESTS 9 61 0
112721455 Sabuj_arif A April 11, 2021, 6:58 p.m. OK Python 3 TESTS 9 61 0
112719705 samyaksrivastava9 A April 11, 2021, 6:32 p.m. OK Python 3 TESTS 9 61 0
112715892 nayan007 A April 11, 2021, 5:44 p.m. OK Python 3 TESTS 9 61 0
112706915 PilotNatural A April 11, 2021, 4:27 p.m. OK Python 3 TESTS 9 61 0
112750249 ljw538 A April 12, 2021, 6 a.m. OK Python 3 TESTS 9 62 0
112748818 manas17 A April 12, 2021, 5:38 a.m. OK Python 3 TESTS 9 62 0
112743847 ssvb A April 12, 2021, 4:09 a.m. OK Ruby 3 TESTS 9 249 102400
112737111 markzhou A April 12, 2021, 2:13 a.m. OK Rust TESTS 9 31 0

remove filters

Back to search problems