Codeforces Round 853 (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
1789 Codeforces Round 853 (Div. 2) FINISHED False 7200 59845163 Feb. 25, 2023, 2:20 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20334 ) A Serval and Mocha's Array PROGRAMMING brute force math number theory

B"Mocha likes arrays, and Serval gave her an array consisting of positive integers as a gift. Mocha thinks that for an array of positive integers a , it is good iff the greatest common divisor of all the elements in a is no more than its length. And for an array of at least 2 positive integers, it is beautiful iff all of its prefixes whose length is no less than 2 are good. For example: Now Mocha gives you the gift array a of n positive integers, and she wants to know whether array a could become beautiful by reordering the elements in a . It is allowed to keep the array a unchanged. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 500 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= q n <= q 100 ) -- the length of array a . The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 1 <= q a_1,a_2, ldots,a_n <= q 10^6 ) -- the elements of array a . For each test case, print Yes if it is possible to reorder the elements in a to make it beautiful, and print No if not. You can output Yes and No in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response). In the first test case, neither [3,6] nor [6,3] are beautiful, so it's impossible to obtain a beautiful array by reordering the elements in a . In the second test case, [1,2,4] is already beautiful. Keeping the array a unchanged can obtain a beautiful array. "...

Tutorials

Codeforces Round #853 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
194967536 Rokisek A Feb. 25, 2023, 4:08 p.m. OK C# 10 TESTS 21 187 2969600
194963866 RongDuJiKsp A Feb. 25, 2023, 3:54 p.m. OK GNU C11 TESTS 21 156 0
194967111 evan30102001flair A Feb. 25, 2023, 4:06 p.m. OK GNU C11 TESTS 21 156 0
194985615 Vaishnavi. A Feb. 25, 2023, 6:46 p.m. OK GNU C11 TESTS 21 156 0
194996327 ashh18 A Feb. 25, 2023, 9:24 p.m. OK GNU C11 TESTS 21 156 0
194978480 22HuKaiwen A Feb. 25, 2023, 5:34 p.m. OK GNU C11 TESTS 21 156 0
194980630 MihirVai A Feb. 25, 2023, 5:55 p.m. OK GNU C11 TESTS 21 156 0
194982920 aytidaxd A Feb. 25, 2023, 6:17 p.m. OK GNU C11 TESTS 21 156 0
194964506 WarnedParable A Feb. 25, 2023, 3:56 p.m. OK GNU C11 TESTS 21 171 0
195014177 Smallorange A Feb. 26, 2023, 5:03 a.m. OK GNU C11 TESTS 21 171 0
194976153 Cap_Cold A Feb. 25, 2023, 5:15 p.m. OK GNU C11 TESTS 21 186 0
195002990 taemie A Feb. 26, 2023, 12:01 a.m. OK GNU C++14 TESTS 21 31 0
194958972 _Stein_ A Feb. 25, 2023, 3:36 p.m. OK GNU C++14 TESTS 21 46 102400
194976487 its_code_fu_panda A Feb. 25, 2023, 5:17 p.m. OK GNU C++14 TESTS 21 77 102400
194964500 Ashik_C A Feb. 25, 2023, 3:56 p.m. OK GNU C++14 TESTS 21 93 0
194973614 rakshit_2812 A Feb. 25, 2023, 4:59 p.m. OK GNU C++14 TESTS 21 93 0
194959325 turjotasin A Feb. 25, 2023, 3:38 p.m. OK GNU C++14 TESTS 21 93 0
194983171 Bittu05 A Feb. 25, 2023, 6:20 p.m. OK GNU C++14 TESTS 21 109 0
194974987 tawhid2861 A Feb. 25, 2023, 5:07 p.m. OK GNU C++14 TESTS 21 124 0
194966750 Sahsubham A Feb. 25, 2023, 4:04 p.m. OK GNU C++14 TESTS 21 124 0
194966631 chunyou A Feb. 25, 2023, 4:04 p.m. OK GNU C++14 TESTS 21 124 0
194966950 prashant_20 A Feb. 25, 2023, 4:05 p.m. OK GNU C++17 TESTS 21 31 102400
194974380 hammar A Feb. 25, 2023, 5:04 p.m. OK GNU C++17 TESTS 21 31 102400
194984057 incognito123 A Feb. 25, 2023, 6:30 p.m. OK GNU C++17 TESTS 21 46 0
194978703 pradyumnkangule A Feb. 25, 2023, 5:36 p.m. OK GNU C++17 TESTS 21 46 0
194961219 NAHID_36 A Feb. 25, 2023, 3:44 p.m. OK GNU C++17 TESTS 21 46 102400
194974702 Remake_man A Feb. 25, 2023, 5:05 p.m. OK GNU C++17 TESTS 21 46 102400
194988156 _Avadhut A Feb. 25, 2023, 7:18 p.m. OK GNU C++17 TESTS 21 46 102400
194985163 realshady105 A Feb. 25, 2023, 6:41 p.m. OK GNU C++17 TESTS 21 61 102400
194958246 Binary_Beast007 A Feb. 25, 2023, 3:35 p.m. OK GNU C++17 TESTS 21 62 0
195016630 sixers A Feb. 26, 2023, 5:42 a.m. OK GNU C++17 TESTS 21 62 102400
194959848 hithu A Feb. 25, 2023, 3:39 p.m. OK GNU C++17 (64) TESTS 21 46 0
194964356 rangon A Feb. 25, 2023, 3:55 p.m. OK GNU C++17 (64) TESTS 21 62 0
195007578 return-111 A Feb. 26, 2023, 2:22 a.m. OK GNU C++17 (64) TESTS 21 140 0
194996023 y_combinator A Feb. 25, 2023, 9:20 p.m. OK GNU C++17 (64) TESTS 21 140 0
194992202 pritish_001 A Feb. 25, 2023, 8:14 p.m. OK GNU C++17 (64) TESTS 21 140 0
194993877 ihabawad18 A Feb. 25, 2023, 8:42 p.m. OK GNU C++17 (64) TESTS 21 140 0
194987886 vishal_7_24 A Feb. 25, 2023, 7:14 p.m. OK GNU C++17 (64) TESTS 21 140 0
194981582 Yogeek A Feb. 25, 2023, 6:04 p.m. OK GNU C++17 (64) TESTS 21 140 0
195004284 xioachou A Feb. 26, 2023, 12:49 a.m. OK GNU C++17 (64) TESTS 21 140 0
195004476 Colblue A Feb. 26, 2023, 12:56 a.m. OK GNU C++17 (64) TESTS 21 140 0
194988656 Hamdy_Salem A Feb. 25, 2023, 7:25 p.m. OK GNU C++20 (64) TESTS 21 31 0
195001905 ParangVo A Feb. 25, 2023, 11:26 p.m. OK GNU C++20 (64) TESTS 21 31 0
194992452 Ahmed_Sofi A Feb. 25, 2023, 8:18 p.m. OK GNU C++20 (64) TESTS 21 46 0
194994736 Sofi A Feb. 25, 2023, 8:57 p.m. OK GNU C++20 (64) TESTS 21 46 0
194979370 DCODER_13 A Feb. 25, 2023, 5:43 p.m. OK GNU C++20 (64) TESTS 21 46 0
194956485 yuxx A Feb. 25, 2023, 3:29 p.m. OK GNU C++20 (64) TESTS 21 46 409600
194974441 OK_Wa A Feb. 25, 2023, 5:04 p.m. OK GNU C++20 (64) TESTS 21 62 0
194984679 madhav_23 A Feb. 25, 2023, 6:36 p.m. OK GNU C++20 (64) TESTS 21 62 0
194975335 Azalea05 A Feb. 25, 2023, 5:09 p.m. OK GNU C++20 (64) TESTS 21 78 0
194981125 yolomashi A Feb. 25, 2023, 5:59 p.m. OK GNU C++20 (64) TESTS 21 78 0
194984356 _samit_ A Feb. 25, 2023, 6:33 p.m. OK Go TESTS 21 249 819200
195006168 s.afsan A Feb. 26, 2023, 1:47 a.m. OK Java 11 TESTS 21 295 0
194982046 XIN A Feb. 25, 2023, 6:08 p.m. OK Java 11 TESTS 21 312 0
194984093 yudi23 A Feb. 25, 2023, 6:30 p.m. OK Java 11 TESTS 21 327 0
194956590 Sudhanshu_03 A Feb. 25, 2023, 3:29 p.m. OK Java 11 TESTS 21 327 0
194956460 neelakshsharma1997 A Feb. 25, 2023, 3:29 p.m. OK Java 11 TESTS 21 327 0
194977029 Hinnawi24 A Feb. 25, 2023, 5:22 p.m. OK Java 11 TESTS 21 358 0
194973543 SAY_NO_TO_EDITORIAL A Feb. 25, 2023, 4:59 p.m. OK Java 11 TESTS 21 374 0
194998903 coffeeCoder69 A Feb. 25, 2023, 10:10 p.m. OK Java 11 TESTS 21 405 0
194978944 durgeshpoint111 A Feb. 25, 2023, 5:38 p.m. OK Java 11 TESTS 21 405 0
194981429 ilasiawo A Feb. 25, 2023, 6:02 p.m. OK Java 11 TESTS 21 420 0
195011176 vismay__yerunkar A Feb. 26, 2023, 3:57 a.m. OK Java 17 TESTS 21 312 512000
195009641 shashank122343524 A Feb. 26, 2023, 3:16 a.m. OK Java 17 TESTS 21 327 512000
194980203 devrtc0 A Feb. 25, 2023, 5:51 p.m. OK Java 17 TESTS 21 342 512000
194989618 MaximSucks A Feb. 25, 2023, 7:38 p.m. OK Java 17 TESTS 21 343 204800
194966369 anupam_das_2011 A Feb. 25, 2023, 4:03 p.m. OK Java 17 TESTS 21 420 0
194968860 thatsiddharth A Feb. 25, 2023, 4:13 p.m. OK Java 17 TESTS 21 421 819200
195013922 The_Blazing A Feb. 26, 2023, 4:58 a.m. OK Java 17 TESTS 21 452 819200
194970668 2100030563cseh A Feb. 25, 2023, 4:19 p.m. OK Java 17 TESTS 21 467 307200
194979027 Suraj1607 A Feb. 25, 2023, 5:39 p.m. OK Java 17 TESTS 21 467 409600
194961752 KLU_2100031350 A Feb. 25, 2023, 3:46 p.m. OK Java 17 TESTS 21 467 819200
195007546 one_line A Feb. 26, 2023, 2:21 a.m. OK Java 8 TESTS 21 248 0
195008010 semantyc A Feb. 26, 2023, 2:32 a.m. OK Java 8 TESTS 21 249 0
194992070 raj_shahh A Feb. 25, 2023, 8:12 p.m. OK Java 8 TESTS 21 249 0
194987092 helmishobaki A Feb. 25, 2023, 7:05 p.m. OK Java 8 TESTS 21 265 0
194969546 ljaewon97 A Feb. 25, 2023, 4:16 p.m. OK Java 8 TESTS 21 265 0
194966804 crudeCode A Feb. 25, 2023, 4:05 p.m. OK Java 8 TESTS 21 280 0
194984147 2jz-gte A Feb. 25, 2023, 6:31 p.m. OK Java 8 TESTS 21 327 0
194981029 toufique_husein A Feb. 25, 2023, 5:58 p.m. OK Java 8 TESTS 21 327 0
194956707 rishi_diwaker A Feb. 25, 2023, 3:30 p.m. OK Java 8 TESTS 21 327 0
195007161 AnandKumar1008 A Feb. 26, 2023, 2:13 a.m. OK Java 8 TESTS 21 342 0
194996137 amurion97 A Feb. 25, 2023, 9:21 p.m. OK JavaScript TESTS 21 202 1331200
194960140 jzunigacoayla A Feb. 25, 2023, 3:40 p.m. OK Kotlin 1.7 TESTS 21 842 19968000
194963205 wo_shi_da_peng A Feb. 25, 2023, 3:51 p.m. OK MS C++ 2017 TESTS 21 171 409600
194961383 AugensternQ A Feb. 25, 2023, 3:45 p.m. OK MS C++ 2017 TESTS 21 171 409600
194964867 Tor_250 A Feb. 25, 2023, 3:57 p.m. OK MS C++ 2017 TESTS 21 186 0
194956731 yixi A Feb. 25, 2023, 3:30 p.m. OK MS C++ 2017 TESTS 21 187 0
194959018 Tory_A A Feb. 25, 2023, 3:37 p.m. OK MS C++ 2017 TESTS 21 187 819200
194958836 AC1DLOVEEE A Feb. 25, 2023, 3:36 p.m. OK MS C++ 2017 TESTS 21 218 0
194976057 aadrito A Feb. 25, 2023, 5:14 p.m. OK MS C++ 2017 TESTS 21 358 0
194982172 Nanouklol A Feb. 25, 2023, 6:09 p.m. OK Node.js TESTS 21 280 4812800
194980102 tryingit A Feb. 25, 2023, 5:50 p.m. OK Node.js TESTS 21 857 5017600
194994113 fme A Feb. 25, 2023, 8:46 p.m. OK PyPy 2 TESTS 21 514 8089600
194999602 ankitesh A Feb. 25, 2023, 10:25 p.m. OK PyPy 3 TESTS 21 264 3072000
194974351 flexr A Feb. 25, 2023, 5:03 p.m. OK PyPy 3 TESTS 21 280 3481600
194983192 Qbira A Feb. 25, 2023, 6:20 p.m. OK PyPy 3 TESTS 21 327 5427200
194999933 VidGa A Feb. 25, 2023, 10:33 p.m. OK PyPy 3 TESTS 21 342 6656000
195009093 JUBHAI A Feb. 26, 2023, 3 a.m. OK PyPy 3 TESTS 21 343 6041600
195013797 sohnryang A Feb. 26, 2023, 4:56 a.m. OK PyPy 3 TESTS 21 358 4608000
194958004 tan_delhi A Feb. 25, 2023, 3:34 p.m. OK PyPy 3 TESTS 21 358 5939200
194960435 safyfishy A Feb. 25, 2023, 3:41 p.m. OK PyPy 3 TESTS 21 373 6246400
194965039 2010030341 A Feb. 25, 2023, 3:58 p.m. OK PyPy 3 TESTS 21 390 5836800
194973658 flexr A Feb. 25, 2023, 4:59 p.m. OK PyPy 3 TESTS 21 436 3788800
194964874 Simon_Sapphire A Feb. 25, 2023, 3:57 p.m. OK PyPy 3-64 TESTS 21 140 6246400
194976905 vedantmishra69 A Feb. 25, 2023, 5:20 p.m. OK PyPy 3-64 TESTS 21 202 3276800
194997702 kavorka A Feb. 25, 2023, 9:48 p.m. OK PyPy 3-64 TESTS 21 202 4096000
194993022 kavorka A Feb. 25, 2023, 8:28 p.m. OK PyPy 3-64 TESTS 21 218 3891200
194992619 kavorka A Feb. 25, 2023, 8:21 p.m. OK PyPy 3-64 TESTS 21 218 3891200
194992556 kavorka A Feb. 25, 2023, 8:20 p.m. OK PyPy 3-64 TESTS 21 218 3891200
194992222 kavorka A Feb. 25, 2023, 8:15 p.m. OK PyPy 3-64 TESTS 21 218 3891200
194997592 kavorka A Feb. 25, 2023, 9:46 p.m. OK PyPy 3-64 TESTS 21 218 4096000
194992441 kavorka A Feb. 25, 2023, 8:18 p.m. OK PyPy 3-64 TESTS 21 218 4096000
194992379 kavorka A Feb. 25, 2023, 8:17 p.m. OK PyPy 3-64 TESTS 21 218 4096000
194979191 cheturtle A Feb. 25, 2023, 5:41 p.m. OK Python 3 TESTS 21 529 0
194979048 cheturtle A Feb. 25, 2023, 5:39 p.m. OK Python 3 TESTS 21 530 0
194978857 cheturtle A Feb. 25, 2023, 5:38 p.m. OK Python 3 TESTS 21 530 0
194978795 cheturtle A Feb. 25, 2023, 5:37 p.m. OK Python 3 TESTS 21 545 0
194992974 MasterKali A Feb. 25, 2023, 8:27 p.m. OK Python 3 TESTS 21 607 0
194964545 kollabhargavre1 A Feb. 25, 2023, 3:56 p.m. OK Python 3 TESTS 21 655 0
194994597 sum_it. A Feb. 25, 2023, 8:55 p.m. OK Python 3 TESTS 21 685 0
194961170 lucky_333 A Feb. 25, 2023, 3:44 p.m. OK Python 3 TESTS 21 685 1638400
194956809 tejeswini_645 A Feb. 25, 2023, 3:30 p.m. OK Python 3 TESTS 21 701 409600
195007158 fathorse A Feb. 26, 2023, 2:12 a.m. OK Python 3 TESTS 21 733 614400
194965157 2100031495cse A Feb. 25, 2023, 3:58 p.m. OK Ruby 3 TESTS 21 655 204800
194965224 yolor69 A Feb. 25, 2023, 3:59 p.m. OK Ruby 3 TESTS 21 670 204800
194956449 klu_2100031710 A Feb. 25, 2023, 3:29 p.m. OK Ruby 3 TESTS 21 670 204800
194959361 SnehilDWivedi A Feb. 25, 2023, 3:38 p.m. OK Ruby 3 TESTS 21 685 204800

remove filters

Back to search problems