Codeforces Round 758 (Div.1 + 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
1608 Codeforces Round 758 (Div.1 + Div. 2) FINISHED False 7200 92606099 Dec. 11, 2021, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11780 ) B Build the Permutation PROGRAMMING constructive algorithms greedy

B"You are given three integers n, a, b . Determine if there exists a permutation p_1, p_2, ldots, p_n of integers from 1 to n , such that: There are exactly a integers i with 2 <= i <= n-1 such that p_{i-1} < p_i > p_{i+1} (in other words, there are exactly a local maximums). There are exactly b integers i with 2 <= i <= n-1 such that p_{i-1} > p_i < p_{i+1} (in other words, there are exactly b local minimums). If such permutations exist, find any such permutation. The first line of the input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of test cases follows. The only line of each test case contains three integers n , a and b ( 2 <= q n <= q 10^5 , 0 <= q a,b <= q n ). The sum of n over all test cases doesn't exceed 10^5 . For each test case, if there is no permutation with the requested properties, output -1 . Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them. In the first test case, one example of such permutations is [1, 3, 2, 4] . In it p_1 < p_2 > p_3 , and 2 is the only such index, and p_2> p_3 < p_4 , and 3 the only such index. One can show that there is no such permutation for the third test case. "...

Tutorials

Editorial of Codeforces Round #758 (Div.1 + Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
138776921 Ruo-SHUi B Dec. 11, 2021, 1:05 p.m. OK Clang++17 Diagnostics TESTS 9 312 1536000
138777011 Ruo-SHUi B Dec. 11, 2021, 1:06 p.m. OK Clang++17 Diagnostics TESTS 9 343 1536000
138777271 777888 B Dec. 11, 2021, 1:08 p.m. OK GNU C11 TESTS 9 390 409600
138823974 _iostream_ B Dec. 12, 2021, 3:10 a.m. OK GNU C++14 TESTS 9 15 0
138823841 c-deguzman B Dec. 12, 2021, 3:05 a.m. OK GNU C++14 TESTS 9 15 0
138818654 ivi. B Dec. 11, 2021, 11:22 p.m. OK GNU C++14 TESTS 9 15 0
138815631 PickledSausage B Dec. 11, 2021, 9:31 p.m. OK GNU C++14 TESTS 9 15 0
138799741 bhaktadip B Dec. 11, 2021, 5:09 p.m. OK GNU C++14 TESTS 9 15 0
138778746 zhangminrui B Dec. 11, 2021, 1:22 p.m. OK GNU C++14 TESTS 9 15 0
138768367 BlackPanther112358 B Dec. 11, 2021, 12:01 p.m. OK GNU C++14 TESTS 9 15 0
138778027 yassatamer99 B Dec. 11, 2021, 1:15 p.m. OK GNU C++14 TESTS 9 15 0
138828415 gyanjd B Dec. 12, 2021, 5:15 a.m. OK GNU C++14 TESTS 9 15 0
138828300 Tiantian2021 B Dec. 12, 2021, 5:12 a.m. OK GNU C++14 TESTS 9 15 0
138806744 xx11 B Dec. 11, 2021, 6:43 p.m. OK GNU C++17 TESTS 9 15 0
138830493 kokoite908 B Dec. 12, 2021, 5:59 a.m. OK GNU C++17 TESTS 9 15 0
138826500 Adibits B Dec. 12, 2021, 4:27 a.m. OK GNU C++17 TESTS 9 15 0
138826351 Dhruvil-Lakhtaria B Dec. 12, 2021, 4:23 a.m. OK GNU C++17 TESTS 9 15 0
138823892 Tywin_The_Lion B Dec. 12, 2021, 3:07 a.m. OK GNU C++17 TESTS 9 15 0
138823056 Kither B Dec. 12, 2021, 2:37 a.m. OK GNU C++17 TESTS 9 15 0
138818449 sanchit06 B Dec. 11, 2021, 11:13 p.m. OK GNU C++17 TESTS 9 15 0
138811728 Sk_kr B Dec. 11, 2021, 8:07 p.m. OK GNU C++17 TESTS 9 15 0
138810770 cerenn B Dec. 11, 2021, 7:49 p.m. OK GNU C++17 TESTS 9 15 0
138803406 Nilesh.ky B Dec. 11, 2021, 5:57 p.m. OK GNU C++17 TESTS 9 15 0
138763405 3am0rab1 B Dec. 11, 2021, 11:47 a.m. OK GNU C++17 (64) TESTS 9 15 0
138829006 Says_Tomabel B Dec. 12, 2021, 5:27 a.m. OK GNU C++17 (64) TESTS 9 15 0
138812288 Kuandyk B Dec. 11, 2021, 8:18 p.m. OK GNU C++17 (64) TESTS 9 15 0
138800456 AbdalrhmanEssam B Dec. 11, 2021, 5:18 p.m. OK GNU C++17 (64) TESTS 9 15 0
138787234 rgnerdplayer B Dec. 11, 2021, 2:40 p.m. OK GNU C++17 (64) TESTS 9 15 0
138772734 Baiiche B Dec. 11, 2021, 12:29 p.m. OK GNU C++17 (64) TESTS 9 15 0
138767197 JustasZ B Dec. 11, 2021, 11:58 a.m. OK GNU C++17 (64) TESTS 9 15 0
138765389 nalin7711 B Dec. 11, 2021, 11:52 a.m. OK GNU C++17 (64) TESTS 9 15 0
138763443 monkedluffy B Dec. 11, 2021, 11:48 a.m. OK GNU C++17 (64) TESTS 9 15 0
138763160 sanchay_ B Dec. 11, 2021, 11:47 a.m. OK GNU C++17 (64) TESTS 9 15 0
138779968 code_x20 B Dec. 11, 2021, 1:34 p.m. OK GNU C++20 (64) TESTS 9 15 0
138810631 MiinaMagdy B Dec. 11, 2021, 7:46 p.m. OK GNU C++20 (64) TESTS 9 15 0
138804408 Noobita_123 B Dec. 11, 2021, 6:11 p.m. OK GNU C++20 (64) TESTS 9 15 0
138803435 vishalmishra998452 B Dec. 11, 2021, 5:58 p.m. OK GNU C++20 (64) TESTS 9 15 0
138797632 TrendBattles B Dec. 11, 2021, 4:41 p.m. OK GNU C++20 (64) TESTS 9 15 0
138797011 TrendBattles B Dec. 11, 2021, 4:33 p.m. OK GNU C++20 (64) TESTS 9 15 0
138790107 surfacewatering B Dec. 11, 2021, 3:12 p.m. OK GNU C++20 (64) TESTS 9 15 0
138790020 lolias B Dec. 11, 2021, 3:11 p.m. OK GNU C++20 (64) TESTS 9 15 0
138788806 LetterC67 B Dec. 11, 2021, 2:57 p.m. OK GNU C++20 (64) TESTS 9 15 0
138784330 amb.kshirsagar B Dec. 11, 2021, 2:12 p.m. OK GNU C++20 (64) TESTS 9 15 0
138761580 rdamir86 B Dec. 11, 2021, 11:42 a.m. OK Go TESTS 9 30 4812800
138772643 glebsamsonov B Dec. 11, 2021, 12:29 p.m. OK Go TESTS 9 46 2969600
138830052 AaParsa B Dec. 12, 2021, 5:50 a.m. OK Haskell TESTS 9 62 11571200
138812973 podtelkin B Dec. 11, 2021, 8:32 p.m. OK Java 11 TESTS 9 155 0
138775348 Eslamprog32 B Dec. 11, 2021, 12:51 p.m. OK Java 11 TESTS 9 171 0
138762120 yaminote B Dec. 11, 2021, 11:44 a.m. OK Java 11 TESTS 9 186 0
138768887 mareshkau B Dec. 11, 2021, 12:02 p.m. OK Java 11 TESTS 9 187 0
138772127 AhmedMaheeb B Dec. 11, 2021, 12:26 p.m. OK Java 11 TESTS 9 202 0
138810708 Nicolas125841 B Dec. 11, 2021, 7:48 p.m. OK Java 11 TESTS 9 202 0
138797732 ak6494285 B Dec. 11, 2021, 4:42 p.m. OK Java 11 TESTS 9 202 23142400
138821368 LongWalk B Dec. 12, 2021, 1:28 a.m. OK Java 11 TESTS 9 217 0
138822879 iamavalon B Dec. 12, 2021, 2:30 a.m. OK Java 11 TESTS 9 217 0
138762335 aamir_1102 B Dec. 11, 2021, 11:44 a.m. OK Java 11 TESTS 9 217 0
138822476 shanks19 B Dec. 12, 2021, 2:14 a.m. OK Java 8 TESTS 9 108 0
138801207 gssakash B Dec. 11, 2021, 5:28 p.m. OK Java 8 TESTS 9 109 0
138791716 nitinrishab2000 B Dec. 11, 2021, 3:32 p.m. OK Java 8 TESTS 9 109 0
138808879 honeysingh18 B Dec. 11, 2021, 7:16 p.m. OK Java 8 TESTS 9 109 0
138767559 AnshX B Dec. 11, 2021, 11:59 a.m. OK Java 8 TESTS 9 124 0
138762747 naitikvarshney B Dec. 11, 2021, 11:45 a.m. OK Java 8 TESTS 9 124 0
138812369 KNIGHT0X300 B Dec. 11, 2021, 8:20 p.m. OK Java 8 TESTS 9 124 0
138802473 Shobhit_Behl B Dec. 11, 2021, 5:44 p.m. OK Java 8 TESTS 9 124 0
138769319 K0ka B Dec. 11, 2021, 12:03 p.m. OK Java 8 TESTS 9 124 0
138769094 arbajk_09 B Dec. 11, 2021, 12:03 p.m. OK Java 8 TESTS 9 124 0
138762909 dextron99 B Dec. 11, 2021, 11:46 a.m. OK Kotlin 1.4 TESTS 9 140 102400
138797861 IvanRozb B Dec. 11, 2021, 4:44 p.m. OK MS C++ 2017 TESTS 9 15 1638400
138786081 AbdelkareemEmara B Dec. 11, 2021, 2:28 p.m. OK MS C++ 2017 TESTS 9 46 409600
138765108 1371597521 B Dec. 11, 2021, 11:52 a.m. OK MS C++ 2017 TESTS 9 61 0
138822663 A_Pier B Dec. 12, 2021, 2:22 a.m. OK MS C++ 2017 TESTS 9 61 409600
138823674 vjudge5 B Dec. 12, 2021, 2:59 a.m. OK MS C++ 2017 TESTS 9 61 819200
138769345 Score12122 B Dec. 11, 2021, 12:03 p.m. OK MS C++ 2017 TESTS 9 62 0
138773414 weisengeng B Dec. 11, 2021, 12:34 p.m. OK MS C++ 2017 TESTS 9 62 409600
138760945 Damirca B Dec. 11, 2021, 11:40 a.m. OK MS C++ 2017 TESTS 9 62 409600
138823798 Agumon B Dec. 12, 2021, 3:04 a.m. OK MS C++ 2017 TESTS 9 62 819200
138771602 NorbertG B Dec. 11, 2021, 12:23 p.m. OK .NET Core C# TESTS 9 140 6348800
138790075 suraj__ B Dec. 11, 2021, 3:12 p.m. OK .NET Core C# TESTS 9 576 4198400
138796269 aman_xoxo B Dec. 11, 2021, 4:24 p.m. OK PyPy 3 TESTS 9 139 5939200
138768171 xluttiy B Dec. 11, 2021, noon OK PyPy 3 TESTS 9 140 8294400
138810260 wolfram_ B Dec. 11, 2021, 7:39 p.m. OK PyPy 3 TESTS 9 155 8089600
138799729 nezzd B Dec. 11, 2021, 5:09 p.m. OK PyPy 3 TESTS 9 155 8499200
138764429 nsharc4 B Dec. 11, 2021, 11:50 a.m. OK PyPy 3 TESTS 9 155 8499200
138787069 K.goyal B Dec. 11, 2021, 2:38 p.m. OK PyPy 3 TESTS 9 170 9523200
138763962 Harshit_Garg B Dec. 11, 2021, 11:49 a.m. OK PyPy 3 TESTS 9 171 8908800
138762136 yonsweng B Dec. 11, 2021, 11:44 a.m. OK PyPy 3 TESTS 9 202 10444800
138802909 nezzd B Dec. 11, 2021, 5:50 p.m. OK PyPy 3 TESTS 9 217 9216000
138822535 _Shubham B Dec. 12, 2021, 2:17 a.m. OK PyPy 3 TESTS 9 218 8192000
138787590 jaglike_makkar B Dec. 11, 2021, 2:44 p.m. OK PyPy 3-64 TESTS 9 171 6963200
138825106 rutz12 B Dec. 12, 2021, 3:47 a.m. OK PyPy 3-64 TESTS 9 202 7168000
138782836 p_r_a_n_a_v B Dec. 11, 2021, 1:58 p.m. OK PyPy 3-64 TESTS 9 217 7168000
138777464 nitish420 B Dec. 11, 2021, 1:10 p.m. OK PyPy 3-64 TESTS 9 218 7372800
138796418 aFuentes B Dec. 11, 2021, 4:26 p.m. OK PyPy 3-64 TESTS 9 249 5939200
138826789 sakurahashu B Dec. 12, 2021, 4:36 a.m. OK PyPy 3-64 TESTS 9 265 7680000
138760625 mik_shakin B Dec. 11, 2021, 11:39 a.m. OK PyPy 3-64 TESTS 9 312 4710400
138764383 Code_Warrior143 B Dec. 11, 2021, 11:50 a.m. OK PyPy 3-64 TESTS 9 358 5017600
138768314 Neketman B Dec. 11, 2021, 12:01 p.m. OK PyPy 3-64 TESTS 9 389 4812800
138762131 Adolf988 B Dec. 11, 2021, 11:44 a.m. OK PyPy 3-64 TESTS 9 482 5632000
138793194 OLOGY B Dec. 11, 2021, 3:49 p.m. OK Python 2 TESTS 9 61 5836800
138773211 OLOGY B Dec. 11, 2021, 12:33 p.m. OK Python 2 TESTS 9 62 5939200
138776258 OLOGY B Dec. 11, 2021, 12:59 p.m. OK Python 2 TESTS 9 77 5836800
138777538 OLOGY B Dec. 11, 2021, 1:11 p.m. OK Python 2 TESTS 9 77 5939200
138814546 Ratree B Dec. 11, 2021, 9:04 p.m. OK Python 3 TESTS 9 93 5939200
138769914 Yusif B Dec. 11, 2021, 12:04 p.m. OK Python 3 TESTS 9 108 6553600
138764503 gesserit B Dec. 11, 2021, 11:51 a.m. OK Python 3 TESTS 9 109 9113600
138779440 Capture_A_Lag B Dec. 11, 2021, 1:29 p.m. OK Python 3 TESTS 9 124 7372800
138776801 pratyanch_jain B Dec. 11, 2021, 1:04 p.m. OK Python 3 TESTS 9 139 1536000
138772680 NS3081992 B Dec. 11, 2021, 12:29 p.m. OK Python 3 TESTS 9 155 11264000
138770141 xinzihang B Dec. 11, 2021, 12:04 p.m. OK Python 3 TESTS 9 171 2764800
138775347 ashishup1999 B Dec. 11, 2021, 12:51 p.m. OK Python 3 TESTS 9 171 2867200
138772831 MIRE B Dec. 11, 2021, 12:30 p.m. OK Python 3 TESTS 9 171 2969600
138771734 nathanivanshaj B Dec. 11, 2021, 12:23 p.m. OK Python 3 TESTS 9 171 3072000
138766111 Avanta B Dec. 11, 2021, 11:54 a.m. OK Rust 2021 TESTS 9 15 5734400

remove filters

Back to search problems