Codeforces Round 836 (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
1758 Codeforces Round 836 (Div. 2) FINISHED False 7200 67875863 Nov. 25, 2022, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13988 ) C Almost All Multiples PROGRAMMING greedy number theory

B'Given two integers n and x , a permutation ^{ dagger} p of length n is called funny if p_i is a multiple of i for all 1 <= q i <= q n - 1 , p_n = 1 , and p_1 = x . Find the lexicographically minimal ^{ ddagger} funny permutation, or report that no such permutation exists. ^{ dagger} A permutation of length n is an array consisting of each of the integers from 1 to n exactly once. ^{ ddagger} Let a and b be permutations of length n . Then a is lexicographically smaller than b if in the first position i where a and b differ, a_i < b_i . A permutation is lexicographically minimal if it is lexicographically smaller than all other permutations. The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of the test cases follows. The only line of each test case contains two integers n and x ( 2 <= q n <= q 2 cdot 10^5 ; 1 < x <= q n ). The sum of n across all test cases does not exceed 2 cdot 10^5 . For each test case, if the answer exists, output n distinct integers p_1, p_2, ... , p_n ( 1 <= q p_i <= q n ) -- the lexicographically minimal funny permutation p . Otherwise, output -1 . In the first test case, the permutation [3,2,1] satisfies all the conditions: p_1=3 , p_3=1 , and: In the second test case, the permutation [2,4,3,1] satisfies all the conditions: p_1=2 , p_4=1 , and: We can show that these permutations are lexicographically minimal. No such permutations exist in the third test case. '...

Tutorials

Codeforces Round #836 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
182549549 tahtarovserver C Nov. 25, 2022, 6:25 p.m. OK C# 8 TESTS 12 171 10342400
182557820 QiuDer C Nov. 25, 2022, 7:14 p.m. OK Clang++20 Diagnostics TESTS 12 623 1024000
182554356 anogroup C Nov. 25, 2022, 6:52 p.m. OK Clang++20 Diagnostics TESTS 12 654 1843200
182558236 QiuDer C Nov. 25, 2022, 7:18 p.m. OK Clang++20 Diagnostics TESTS 12 717 1024000
182591407 Interested C Nov. 26, 2022, 4:43 a.m. OK GNU C11 TESTS 12 811 819200
182572156 SAFIN07 C Nov. 25, 2022, 9:52 p.m. OK GNU C11 TESTS 12 811 819200
182573933 SAFIN07 C Nov. 25, 2022, 10:32 p.m. OK GNU C11 TESTS 12 811 819200
182591628 Mushfiqur_ C Nov. 26, 2022, 4:45 a.m. OK GNU C11 TESTS 12 826 0
182555267 Abhishek_Tewatia C Nov. 25, 2022, 6:57 p.m. OK GNU C11 TESTS 12 858 819200
182540236 Miraemon C Nov. 25, 2022, 5:32 p.m. OK GNU C11 TESTS 12 888 1638400
182556800 Mhamad_aboaljood C Nov. 25, 2022, 7:08 p.m. OK GNU C++14 TESTS 12 31 0
182532813 leijinpeng C Nov. 25, 2022, 5:13 p.m. OK GNU C++14 TESTS 12 31 0
182559925 piwd_sedoc C Nov. 25, 2022, 7:31 p.m. OK GNU C++14 TESTS 12 31 102400
182557381 Molo5ya C Nov. 25, 2022, 7:12 p.m. OK GNU C++14 TESTS 12 31 102400
182577083 Molo5ya C Nov. 25, 2022, 11:45 p.m. OK GNU C++14 TESTS 12 31 102400
182588016 Cycyes C Nov. 26, 2022, 4:01 a.m. OK GNU C++14 TESTS 12 31 204800
182589967 Naim_Hasan_Pappu C Nov. 26, 2022, 4:26 a.m. OK GNU C++14 TESTS 12 31 819200
182589515 tonmoy197 C Nov. 26, 2022, 4:20 a.m. OK GNU C++14 TESTS 12 31 819200
182577943 OvO_Zuo C Nov. 26, 2022, 12:17 a.m. OK GNU C++14 TESTS 12 31 819200
182598773 rons_07 C Nov. 26, 2022, 6 a.m. OK GNU C++14 TESTS 12 31 819200
182582961 Dert_dj C Nov. 26, 2022, 2:28 a.m. OK GNU C++17 TESTS 12 30 819200
182577957 PUNGqw C Nov. 26, 2022, 12:17 a.m. OK GNU C++17 TESTS 12 30 1638400
182556378 Garvit_Goyal C Nov. 25, 2022, 7:05 p.m. OK GNU C++17 TESTS 12 30 1638400
182556314 garvittestbed C Nov. 25, 2022, 7:05 p.m. OK GNU C++17 TESTS 12 30 1638400
182539510 no_recomendable C Nov. 25, 2022, 5:30 p.m. OK GNU C++17 TESTS 12 31 0
182593857 arpitblagan27 C Nov. 26, 2022, 5:11 a.m. OK GNU C++17 TESTS 12 31 0
182561046 quzyte C Nov. 25, 2022, 7:40 p.m. OK GNU C++17 TESTS 12 31 0
182552940 S_2289_S C Nov. 25, 2022, 6:44 p.m. OK GNU C++17 TESTS 12 31 0
182546136 aliasgar.OPC C Nov. 25, 2022, 6:08 p.m. OK GNU C++17 TESTS 12 31 0
182540877 anuragitme C Nov. 25, 2022, 5:33 p.m. OK GNU C++17 TESTS 12 31 102400
182575009 Awesome3.14 C Nov. 25, 2022, 10:59 p.m. OK GNU C++17 (64) TESTS 12 30 819200
182535439 wqy2022 C Nov. 25, 2022, 5:20 p.m. OK GNU C++17 (64) TESTS 12 30 819200
182537272 Mac.Rose C Nov. 25, 2022, 5:25 p.m. OK GNU C++17 (64) TESTS 12 30 1638400
182533911 Mercersfire C Nov. 25, 2022, 5:16 p.m. OK GNU C++17 (64) TESTS 12 31 0
182584039 hhh3 C Nov. 26, 2022, 2:50 a.m. OK GNU C++17 (64) TESTS 12 31 0
182596249 wmbbb C Nov. 26, 2022, 5:36 a.m. OK GNU C++17 (64) TESTS 12 31 204800
182589323 donald_duck123 C Nov. 26, 2022, 4:18 a.m. OK GNU C++17 (64) TESTS 12 31 716800
182581758 s7win99 C Nov. 26, 2022, 2:03 a.m. OK GNU C++17 (64) TESTS 12 31 819200
182584838 haengsyo C Nov. 26, 2022, 3:05 a.m. OK GNU C++17 (64) TESTS 12 31 819200
182584726 katsu. C Nov. 26, 2022, 3:04 a.m. OK GNU C++17 (64) TESTS 12 31 819200
182546274 hankus C Nov. 25, 2022, 6:09 p.m. OK GNU C++20 (64) TESTS 12 15 0
182547070 Ankushkumar11903 C Nov. 25, 2022, 6:13 p.m. OK GNU C++20 (64) TESTS 12 15 0
182550799 s_k_a_r_a C Nov. 25, 2022, 6:31 p.m. OK GNU C++20 (64) TESTS 12 15 0
182563649 Eskler C Nov. 25, 2022, 8:02 p.m. OK GNU C++20 (64) TESTS 12 15 0
182550520 BrehamPie C Nov. 25, 2022, 6:30 p.m. OK GNU C++20 (64) TESTS 12 15 819200
182546273 Asif732 C Nov. 25, 2022, 6:09 p.m. OK GNU C++20 (64) TESTS 12 15 819200
182548078 Pikku C Nov. 25, 2022, 6:17 p.m. OK GNU C++20 (64) TESTS 12 15 819200
182583505 zwu2020015020 C Nov. 26, 2022, 2:38 a.m. OK GNU C++20 (64) TESTS 12 15 819200
182585532 LittleSeaMonster C Nov. 26, 2022, 3:18 a.m. OK GNU C++20 (64) TESTS 12 15 819200
182588902 Rajiun_nabi C Nov. 26, 2022, 4:13 a.m. OK GNU C++20 (64) TESTS 12 15 819200
182540367 treasuryonly C Nov. 25, 2022, 5:32 p.m. OK Go TESTS 12 46 3276800
182559144 D05T0N C Nov. 25, 2022, 7:25 p.m. OK Go TESTS 12 46 38297600
182584398 tongtongac C Nov. 26, 2022, 2:57 a.m. OK Go TESTS 12 561 3174400
182595591 peiyeliu C Nov. 26, 2022, 5:29 a.m. OK Java 11 TESTS 12 202 0
182592869 vijender_8601 C Nov. 26, 2022, 5 a.m. OK Java 11 TESTS 12 202 0
182560397 harsh.bhandari.v C Nov. 25, 2022, 7:34 p.m. OK Java 11 TESTS 12 202 0
182591786 daftdove C Nov. 26, 2022, 4:47 a.m. OK Java 11 TESTS 12 217 0
182578068 thegoodbagel C Nov. 26, 2022, 12:22 a.m. OK Java 11 TESTS 12 217 0
182534532 Alex_by C Nov. 25, 2022, 5:18 p.m. OK Java 11 TESTS 12 248 0
182547115 princeayush04 C Nov. 25, 2022, 6:13 p.m. OK Java 11 TESTS 12 249 0
182568939 tiger10092002 C Nov. 25, 2022, 9:01 p.m. OK Java 11 TESTS 12 249 44339200
182535539 ritik0602 C Nov. 25, 2022, 5:20 p.m. OK Java 11 TESTS 12 264 0
182582412 mcrash12 C Nov. 26, 2022, 2:17 a.m. OK Java 11 TESTS 12 280 0
182549395 yashbhardwaj24 C Nov. 25, 2022, 6:24 p.m. OK Java 17 TESTS 12 218 0
182546022 Srikanth1777 C Nov. 25, 2022, 6:08 p.m. OK Java 17 TESTS 12 233 307200
182536080 tbs-jyy C Nov. 25, 2022, 5:22 p.m. OK Java 17 TESTS 12 234 307200
182550268 Eslam_Ahmed C Nov. 25, 2022, 6:28 p.m. OK Java 17 TESTS 12 234 512000
182576704 koolkartik C Nov. 25, 2022, 11:30 p.m. OK Java 17 TESTS 12 248 614400
182549117 Utsav82 C Nov. 25, 2022, 6:22 p.m. OK Java 17 TESTS 12 249 0
182538824 ghost24601 C Nov. 25, 2022, 5:28 p.m. OK Java 17 TESTS 12 264 614400
182582872 _lwq_123_ C Nov. 26, 2022, 2:27 a.m. OK Java 17 TESTS 12 280 716800
182549463 soumit915 C Nov. 25, 2022, 6:24 p.m. OK Java 17 TESTS 12 295 16179200
182571669 destroyer11 C Nov. 25, 2022, 9:43 p.m. OK Java 17 TESTS 12 811 921600
182585231 -crazy_coder- C Nov. 26, 2022, 3:13 a.m. OK Java 8 TESTS 12 124 0
182582130 Parimal C Nov. 26, 2022, 2:11 a.m. OK Java 8 TESTS 12 124 0
182575867 bruhgamer C Nov. 25, 2022, 11:12 p.m. OK Java 8 TESTS 12 124 0
182568581 vaibhav_1710 C Nov. 25, 2022, 8:56 p.m. OK Java 8 TESTS 12 124 0
182568077 Swapniltri C Nov. 25, 2022, 8:49 p.m. OK Java 8 TESTS 12 124 0
182567920 Swapniltri C Nov. 25, 2022, 8:47 p.m. OK Java 8 TESTS 12 124 0
182566284 Mohamed308 C Nov. 25, 2022, 8:29 p.m. OK Java 8 TESTS 12 124 0
182586013 swarup_312 C Nov. 26, 2022, 3:27 a.m. OK Java 8 TESTS 12 124 2560000
182554364 Rayhan_07 C Nov. 25, 2022, 6:52 p.m. OK Java 8 TESTS 12 139 0
182545876 leonlian C Nov. 25, 2022, 6:07 p.m. OK Java 8 TESTS 12 139 0
182538524 reosfire C Nov. 25, 2022, 5:28 p.m. OK Kotlin 1.7 TESTS 12 998 25088000
182566236 aadrito C Nov. 25, 2022, 8:29 p.m. OK MS C++ 2017 TESTS 12 109 0
182556091 danilgrig C Nov. 25, 2022, 7:03 p.m. OK MS C++ 2017 TESTS 12 109 819200
182541821 timusmanovs C Nov. 25, 2022, 5:34 p.m. OK MS C++ 2017 TESTS 12 124 819200
182540177 Eldies C Nov. 25, 2022, 5:31 p.m. OK MS C++ 2017 TESTS 12 124 1331200
182533845 gavvah C Nov. 25, 2022, 5:16 p.m. OK MS C++ 2017 TESTS 12 139 1638400
182552208 plevande C Nov. 25, 2022, 6:39 p.m. OK PyPy 3 TESTS 12 202 21811200
182594283 hola723 C Nov. 26, 2022, 5:15 a.m. OK PyPy 3 TESTS 12 265 11571200
182576653 hxu10 C Nov. 25, 2022, 11:28 p.m. OK PyPy 3 TESTS 12 280 13312000
182537266 flygon C Nov. 25, 2022, 5:25 p.m. OK PyPy 3 TESTS 12 295 13414400
182564320 Justin_Foley C Nov. 25, 2022, 8:09 p.m. OK PyPy 3 TESTS 12 327 12390400
182550951 manish.17 C Nov. 25, 2022, 6:32 p.m. OK PyPy 3 TESTS 12 390 11571200
182544893 shinever C Nov. 25, 2022, 6:04 p.m. OK PyPy 3 TESTS 12 404 10547200
182537369 ACensation C Nov. 25, 2022, 5:25 p.m. OK PyPy 3 TESTS 12 405 12083200
182541188 Homeo C Nov. 25, 2022, 5:33 p.m. OK PyPy 3 TESTS 12 436 12800000
182597531 hola723 C Nov. 26, 2022, 5:48 a.m. OK PyPy 3 TESTS 12 451 12800000
182589612 hkwu6013 C Nov. 26, 2022, 4:21 a.m. OK PyPy 3-64 TESTS 12 124 14848000
182533930 biglunchdude C Nov. 25, 2022, 5:16 p.m. OK PyPy 3-64 TESTS 12 140 16179200
182592696 D.V.Aravind C Nov. 26, 2022, 4:58 a.m. OK PyPy 3-64 TESTS 12 155 16076800
182561570 Turtleeee C Nov. 25, 2022, 7:44 p.m. OK PyPy 3-64 TESTS 12 155 26521600
182549569 titia C Nov. 25, 2022, 6:25 p.m. OK PyPy 3-64 TESTS 12 171 14131200
182535244 FrozenKandy C Nov. 25, 2022, 5:20 p.m. OK PyPy 3-64 TESTS 12 171 14131200
182593217 MohamedHamed123 C Nov. 26, 2022, 5:04 a.m. OK PyPy 3-64 TESTS 12 171 14233600
182593167 2momo2 C Nov. 26, 2022, 5:03 a.m. OK PyPy 3-64 TESTS 12 171 14233600
182589427 fathorse C Nov. 26, 2022, 4:19 a.m. OK PyPy 3-64 TESTS 12 171 15155200
182592585 D.V.Aravind C Nov. 26, 2022, 4:57 a.m. OK PyPy 3-64 TESTS 12 171 15974400
182535330 xph_4n C Nov. 25, 2022, 5:20 p.m. OK Python 2 TESTS 12 124 15360000
182536010 sam1064max C Nov. 25, 2022, 5:22 p.m. OK Python 3 TESTS 12 139 18534400
182539480 vule.coffo C Nov. 25, 2022, 5:30 p.m. OK Python 3 TESTS 12 186 14028800
182540686 xueqibhlt C Nov. 25, 2022, 5:32 p.m. OK Python 3 TESTS 12 202 10547200
182583747 M.MUEED.AWAIS C Nov. 26, 2022, 2:43 a.m. OK Python 3 TESTS 12 295 5222400
182569010 PrakshalJain C Nov. 25, 2022, 9:02 p.m. OK Python 3 TESTS 12 311 6041600
182591764 aytony C Nov. 26, 2022, 4:47 a.m. OK Python 3 TESTS 12 312 4710400
182537809 shades990 C Nov. 25, 2022, 5:26 p.m. OK Python 3 TESTS 12 327 6451200
182532866 peidi C Nov. 25, 2022, 5:14 p.m. OK Python 3 TESTS 12 343 5222400
182559345 VioletVal C Nov. 25, 2022, 7:26 p.m. OK Python 3 TESTS 12 373 13721600
182534404 nileshmalav C Nov. 25, 2022, 5:18 p.m. OK Python 3 TESTS 12 374 5222400

remove filters

Back to search problems