Codeforces Round 884 (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
1844 Codeforces Round 884 (Div. 1 + Div. 2) FINISHED False 10800 48180263 July 11, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18604 ) B Permutations & Primes PROGRAMMING constructive algorithms greedy math

B'You are given a positive integer n . In this problem, the operatorname{MEX} of a collection of integers c_1,c_2, ... ,c_k is defined as the smallest positive integer x which does not occur in the collection c . The primality of an array a_1, ... ,a_n is defined as the number of pairs (l,r) such that 1 <= l <= r <= n and operatorname{MEX}(a_l, ... ,a_r) is a prime number. Find any permutation of 1,2, ... ,n with the maximum possible primality among all permutations of 1,2, ... ,n . Note: Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The only line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output n integers: a permutation of 1,2, ... ,n that achieves the maximum possible primality. If there are multiple solutions, print any of them. In the first test case, there are 3 pairs (l,r) with 1 <= l <= r <= 2 , out of which 2 have a prime operatorname{MEX}(a_l, ... ,a_r) : In the second test case, operatorname{MEX}(1) = 2 is prime, so the primality is 1 . In the third test case, the maximum possible primality is 8 . '...

Tutorials

Codeforces Round #884 (Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
213443093 lAMaLOSER B July 12, 2023, 2:32 a.m. OK C# 10 TESTS 13 670 3788800
213422161 Unintelligent_ B July 11, 2023, 8:53 p.m. OK Clang++20 Diagnostics TESTS 12 857 1024000
213422606 NenadDapic B July 11, 2023, 8:59 p.m. OK FPC TESTS 12 545 819200
213399984 kasarlasunilkumar676 B July 11, 2023, 5:27 p.m. OK GNU C11 TESTS 12 873 1638400
213393712 The-Winner B July 11, 2023, 5:07 p.m. OK GNU C++14 TESTS 12 31 819200
213453678 willowcardigan B July 12, 2023, 5:09 a.m. OK GNU C++14 TESTS 13 31 819200
213429597 PCC B July 11, 2023, 11:10 p.m. OK GNU C++14 TESTS 12 31 819200
213392466 FulZERO B July 11, 2023, 5:03 p.m. OK GNU C++14 TESTS 12 31 1638400
213448757 vishal123verma B July 12, 2023, 3:48 a.m. OK GNU C++14 TESTS 13 46 0
213447431 Nityanandayya B July 12, 2023, 3:28 a.m. OK GNU C++14 TESTS 13 46 0
213447302 fulinkang B July 12, 2023, 3:26 a.m. OK GNU C++14 TESTS 13 46 0
213441009 snowca B July 12, 2023, 2:08 a.m. OK GNU C++14 TESTS 13 46 0
213437747 yskm B July 12, 2023, 1:28 a.m. OK GNU C++14 TESTS 13 46 0
213449226 KurashinaAsuka B July 12, 2023, 3:55 a.m. OK GNU C++14 TESTS 13 46 0
213427719 govufpb B July 11, 2023, 10:29 p.m. OK GNU C++17 TESTS 12 31 0
213424001 saifur_shamim B July 11, 2023, 9:20 p.m. OK GNU C++17 TESTS 12 31 0
213407417 dhaneshguptarmoc B July 11, 2023, 6:20 p.m. OK GNU C++17 TESTS 12 31 0
213392973 radheysaykar3 B July 11, 2023, 5:04 p.m. OK GNU C++17 TESTS 12 31 0
213445594 kimmoqt B July 12, 2023, 3:02 a.m. OK GNU C++17 TESTS 13 31 0
213448047 chakshu2022 B July 12, 2023, 3:37 a.m. OK GNU C++17 TESTS 13 31 819200
213437785 unknowndriver B July 12, 2023, 1:28 a.m. OK GNU C++17 TESTS 13 31 819200
213434608 deadbaby B July 12, 2023, 12:47 a.m. OK GNU C++17 TESTS 13 31 819200
213432091 yanke B July 12, 2023, 12:05 a.m. OK GNU C++17 TESTS 13 31 819200
213454836 haochenkang B July 12, 2023, 5:28 a.m. OK GNU C++17 TESTS 13 31 819200
213428226 Xylenox B July 11, 2023, 10:39 p.m. OK GNU C++17 (64) TESTS 12 30 0
213429980 imsuck12 B July 11, 2023, 11:19 p.m. OK GNU C++17 (64) TESTS 12 31 0
213437277 PHarr_ B July 12, 2023, 1:22 a.m. OK GNU C++17 (64) TESTS 13 31 0
213418722 jerefigo B July 11, 2023, 8:11 p.m. OK GNU C++17 (64) TESTS 12 31 0
213411724 mePranav B July 11, 2023, 6:53 p.m. OK GNU C++17 (64) TESTS 12 31 0
213410515 ankancool B July 11, 2023, 6:43 p.m. OK GNU C++17 (64) TESTS 12 31 0
213397857 Xellos B July 11, 2023, 5:20 p.m. OK GNU C++17 (64) TESTS 12 31 0
213454924 Akagi_Ritsuko_219 B July 12, 2023, 5:29 a.m. OK GNU C++17 (64) TESTS 13 31 819200
213456693 Hytidel B July 12, 2023, 5:56 a.m. OK GNU C++17 (64) TESTS 13 31 819200
213423070 enslaved B July 11, 2023, 9:05 p.m. OK GNU C++17 (64) TESTS 12 31 819200
213404967 _cat_is_here B July 11, 2023, 6:06 p.m. OK GNU C++20 (64) TESTS 12 15 0
213429959 knightstour B July 11, 2023, 11:18 p.m. OK GNU C++20 (64) TESTS 12 15 0
213405527 asaecs2 B July 11, 2023, 6:09 p.m. OK GNU C++20 (64) TESTS 12 15 0
213429748 ZOORO B July 11, 2023, 11:13 p.m. OK GNU C++20 (64) TESTS 12 15 819200
213411834 treasuryonly B July 11, 2023, 6:54 p.m. OK GNU C++20 (64) TESTS 12 15 819200
213414522 leonid_perminov B July 11, 2023, 7:22 p.m. OK GNU C++20 (64) TESTS 12 15 1638400
213410306 IbrahimHiarea B July 11, 2023, 6:41 p.m. OK GNU C++20 (64) TESTS 12 30 0
213432541 youhuo B July 12, 2023, 12:13 a.m. OK GNU C++20 (64) TESTS 13 30 0
213406947 Pronoy_Deb B July 11, 2023, 6:17 p.m. OK GNU C++20 (64) TESTS 12 30 0
213402014 Akif_Shaharier24 B July 11, 2023, 5:33 p.m. OK GNU C++20 (64) TESTS 12 30 0
213395461 katomasao B July 11, 2023, 5:12 p.m. OK Haskell TESTS 12 249 8396800
213433902 MiyawakiSakura B July 12, 2023, 12:37 a.m. OK Java 11 TESTS 13 217 0
213408982 varahamihira_ B July 11, 2023, 6:31 p.m. OK Java 11 TESTS 12 233 0
213408441 SAY_NO_TO_EDITORIAL B July 11, 2023, 6:27 p.m. OK Java 11 TESTS 12 280 39219200
213453615 black_devil_9552 B July 12, 2023, 5:08 a.m. OK Java 11 TESTS 13 904 102400
213392970 Chandrakanth174 B July 11, 2023, 5:04 p.m. OK Java 11 TESTS 12 951 0
213414489 Danger_Don B July 11, 2023, 7:22 p.m. OK Java 17 TESTS 12 233 409600
213396104 wizardleen B July 11, 2023, 5:15 p.m. OK Java 17 TESTS 12 264 11264000
213413146 codebook_2000 B July 11, 2023, 7:07 p.m. OK Java 17 TESTS 12 265 716800
213444301 d2s2 B July 12, 2023, 2:46 a.m. OK Java 17 TESTS 13 296 204800
213442386 chuquwan9964 B July 12, 2023, 2:25 a.m. OK Java 17 TESTS 13 296 1024000
213428433 woodyiiiiiii B July 11, 2023, 10:43 p.m. OK Java 17 TESTS 12 327 8396800
213445325 goalboy B July 12, 2023, 2:57 a.m. OK Java 17 TESTS 13 342 17408000
213422294 Vrutik_2809 B July 11, 2023, 8:54 p.m. OK Java 17 TESTS 12 389 4710400
213450613 Biubiu0919 B July 12, 2023, 4:19 a.m. OK Java 17 TESTS 13 826 921600
213395265 Weeb B July 11, 2023, 5:12 p.m. OK Java 17 TESTS 12 888 921600
213428648 raj_shahh B July 11, 2023, 10:49 p.m. OK Java 8 TESTS 12 124 0
213418428 iamdimonis B July 11, 2023, 8:07 p.m. OK Java 8 TESTS 12 124 0
213393007 purealter B July 11, 2023, 5:04 p.m. OK Java 8 TESTS 12 155 0
213418230 bhavesh555 B July 11, 2023, 8:05 p.m. OK Java 8 TESTS 12 170 3174400
213410311 Sumitsingh7 B July 11, 2023, 6:41 p.m. OK Java 8 TESTS 12 171 7372800
213414349 depurador_ik B July 11, 2023, 7:20 p.m. OK Java 8 TESTS 12 187 2457600
213392715 Tjukd45 B July 11, 2023, 5:04 p.m. OK Java 8 TESTS 12 811 0
213395763 Aditi_sinha2002 B July 11, 2023, 5:13 p.m. OK Java 8 TESTS 12 842 0
213416684 ma7ameee7o0o B July 11, 2023, 7:46 p.m. OK JavaScript TESTS 12 93 11776000
213410342 ma7ameee7o0o B July 11, 2023, 6:41 p.m. OK JavaScript TESTS 12 108 11878400
213440231 ishybee B July 12, 2023, 1:59 a.m. OK MS C++ 2017 TESTS 13 155 819200
213420007 ch21btech11036 B July 11, 2023, 8:25 p.m. OK MS C++ 2017 TESTS 12 155 819200
213394813 RSL459 B July 11, 2023, 5:10 p.m. OK MS C++ 2017 TESTS 12 186 2252800
213414616 jvatsal0709 B July 11, 2023, 7:23 p.m. OK PyPy 3 TESTS 12 249 18534400
213409130 varahamihira_ B July 11, 2023, 6:32 p.m. OK PyPy 3 TESTS 12 295 11776000
213408518 varahamihira_ B July 11, 2023, 6:27 p.m. OK PyPy 3 TESTS 12 312 11776000
213453766 debashish_1 B July 12, 2023, 5:11 a.m. OK PyPy 3 TESTS 13 405 10035200
213440350 InHng B July 12, 2023, 2 a.m. OK PyPy 3 TESTS 13 436 10240000
213398017 guyuezh B July 11, 2023, 5:21 p.m. OK PyPy 3 TESTS 12 483 10956800
213416748 oneku16 B July 11, 2023, 7:46 p.m. OK PyPy 3-64 TESTS 12 93 8192000
213418076 damya B July 11, 2023, 8:03 p.m. OK PyPy 3-64 TESTS 12 108 18329600
213449594 Youarenotgood B July 12, 2023, 4:01 a.m. OK PyPy 3-64 TESTS 13 109 14131200
213409777 Mohamed_Hamed B July 11, 2023, 6:36 p.m. OK PyPy 3-64 TESTS 12 109 16793600
213435130 4D4CH1 B July 12, 2023, 12:55 a.m. OK PyPy 3-64 TESTS 13 124 14131200
213406301 CinaDor B July 11, 2023, 6:13 p.m. OK PyPy 3-64 TESTS 12 124 14131200
213413188 Kladrr B July 11, 2023, 7:07 p.m. OK PyPy 3-64 TESTS 12 124 16076800
213409718 Meiir B July 11, 2023, 6:36 p.m. OK PyPy 3-64 TESTS 12 124 16179200
213406163 alxwen711 B July 11, 2023, 6:12 p.m. OK PyPy 3-64 TESTS 12 139 14131200
213425661 RobinFromTheHood B July 11, 2023, 9:50 p.m. OK PyPy 3-64 TESTS 12 139 14233600
213427360 fasika729 B July 11, 2023, 10:22 p.m. OK Python 3 TESTS 12 155 17203200
213429467 vamsi_odyssey B July 11, 2023, 11:07 p.m. OK Python 3 TESTS 12 155 25600000
213410556 ndureja B July 11, 2023, 6:43 p.m. OK Python 3 TESTS 12 171 25600000
213404538 plshelpme B July 11, 2023, 6:04 p.m. OK Python 3 TESTS 12 171 25600000
213443925 HonestIdiot B July 12, 2023, 2:42 a.m. OK Python 3 TESTS 13 187 25600000
213454365 eugalt B July 12, 2023, 5:20 a.m. OK Python 3 TESTS 13 202 10752000
213453848 eugalt B July 12, 2023, 5:12 a.m. OK Python 3 TESTS 13 217 9830400
213453804 eugalt B July 12, 2023, 5:11 a.m. OK Python 3 TESTS 13 233 9830400
213440850 abhinavn004 B July 12, 2023, 2:06 a.m. OK Python 3 TESTS 13 233 11468800
213414712 MutedSolace B July 11, 2023, 7:25 p.m. OK Python 3 TESTS 12 234 11878400
213394737 vivek__jaiswal B July 11, 2023, 5:10 p.m. OK Ruby 3 TESTS 12 342 1024000
213422014 cptahahab B July 11, 2023, 8:51 p.m. OK Rust 2021 TESTS 12 46 9318400

remove filters

Back to search problems