Codeforces Round 665 (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
1401 Codeforces Round 665 (Div. 2) FINISHED False 7200 133802699 Aug. 21, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 24436 ) C Mere Array PROGRAMMING constructive algorithms math number theory number theory sortings sortings

B' You are given an array a_1, a_2, ... , a_n where all a_i are integers and greater than 0 . In one operation, you can choose two different indices i and j ( 1 <= i, j <= n ). If gcd(a_i, a_j) is equal to the minimum element of the whole array a , you can swap a_i and a_j . gcd(x, y) denotes the greatest common divisor (GCD) of integers x and y . Now you 'd like to make a non-decreasing using the operation any number of times (possibly zero). Determine if you can do this. An array a is non-decreasing if and only if a_1 <= a_2 <= ldots <= a_n . The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains one integer n ( 1 <= n <= 10^5 ) -- the length of array a . The second line of each test case contains n positive integers a_1, a_2, ldots a_n ( 1 <= a_i <= 10^9 ) -- the array itself. It is guaranteed that the sum of n over all test cases doesn 't exceed 10^5 . For each test case, output "YES" if it is possible to make the array a non-decreasing using the described operation, or "NO" if it is impossible to do so. In the first and third sample, the array is already non-decreasing. In the second sample, we can swap a_1 and a_3 first, and swap a_1 and a_5 second to make the array non-decreasing. In the forth sample, we cannot the array non-decreasing using the operation. '...

Tutorials

Codeforces Round #665 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
91176641 Vicfred C Aug. 28, 2020, 3:29 a.m. OK D TESTS 20 62 13414400
91029311 HQT2003 C Aug. 26, 2020, 7:39 a.m. OK FPC TESTS 20 61 1228800
91014657 luogu_bot4 C Aug. 26, 2020, 3:54 a.m. OK FPC TESTS 20 62 921600
91573838 YannVoytaa C Sept. 1, 2020, 2:26 p.m. OK GNU C11 TESTS 20 61 1228800
91257628 Lvl999Noob C Aug. 29, 2020, 5:24 a.m. OK GNU C11 TESTS 20 62 819200
90842424 chowdhuryshashwoto C Aug. 24, 2020, 4:03 p.m. OK GNU C11 TESTS 20 62 819200
91538269 tej_code_29 C Sept. 1, 2020, 5:36 a.m. OK GNU C11 TESTS 20 62 819200
90876127 aes_the_tic C Aug. 25, 2020, 7:05 a.m. OK GNU C11 TESTS 20 62 1638400
91328422 aNoobAgain C Aug. 30, 2020, 8:14 a.m. OK GNU C11 TESTS 20 93 4915200
91603423 hjh C Sept. 2, 2020, 12:01 a.m. OK GNU C++11 TESTS 20 31 819200
91038170 vrsashly C Aug. 26, 2020, 9:48 a.m. OK GNU C++11 TESTS 20 31 819200
90886728 AC_yulou C Aug. 25, 2020, 9:32 a.m. OK GNU C++11 TESTS 20 31 1228800
91136293 yuanyuxuan C Aug. 27, 2020, 1:23 p.m. OK GNU C++11 TESTS 20 31 1638400
91041194 Zhu_Xiangyu C Aug. 26, 2020, 10:31 a.m. OK GNU C++11 TESTS 20 31 1638400
91469590 Rayment C Aug. 31, 2020, 7:44 a.m. OK GNU C++11 TESTS 20 31 4505600
90834851 LaiAng8086 C Aug. 24, 2020, 2:35 p.m. OK GNU C++11 TESTS 20 31 4812800
91024605 vjudge1 C Aug. 26, 2020, 6:40 a.m. OK GNU C++11 TESTS 20 31 7987200
91604218 zhtjtcz C Sept. 2, 2020, 12:46 a.m. OK GNU C++11 TESTS 20 31 8499200
91327103 DoorKickers C Aug. 30, 2020, 7:32 a.m. OK GNU C++11 TESTS 20 31 20992000
90867062 ConferenceCall C Aug. 25, 2020, 4:25 a.m. OK GNU C++14 TESTS 20 31 1740800
90824805 vishnu_m C Aug. 24, 2020, 12:25 p.m. OK GNU C++14 TESTS 20 31 4505600
91656961 wxyzabcd0123hjklmno C Sept. 2, 2020, 3:59 p.m. OK GNU C++14 TESTS 20 46 819200
91196533 satvik76 C Aug. 28, 2020, 9:42 a.m. OK GNU C++14 TESTS 20 46 819200
91207260 zhanggengchen C Aug. 28, 2020, 12:31 p.m. OK GNU C++14 TESTS 20 46 819200
91243254 sutharp777 C Aug. 28, 2020, 8:38 p.m. OK GNU C++14 TESTS 20 46 819200
91548331 vjudge5 C Sept. 1, 2020, 8:22 a.m. OK GNU C++14 TESTS 20 46 819200
91548354 MEGA-MIND C Sept. 1, 2020, 8:22 a.m. OK GNU C++14 TESTS 20 46 819200
91549571 tj-black C Sept. 1, 2020, 8:41 a.m. OK GNU C++14 TESTS 20 46 819200
91549822 tj-black C Sept. 1, 2020, 8:45 a.m. OK GNU C++14 TESTS 20 46 819200
90983862 201831990439 C Aug. 25, 2020, 4:35 p.m. OK GNU C++17 TESTS 20 31 5836800
91557354 AIBEK C Sept. 1, 2020, 10:43 a.m. OK GNU C++17 TESTS 20 46 819200
91646567 yashikh2000 C Sept. 2, 2020, 1:54 p.m. OK GNU C++17 TESTS 20 46 819200
91609685 mordecaivelasco C Sept. 2, 2020, 4:08 a.m. OK GNU C++17 TESTS 20 46 819200
91609298 theUnderdog_bahaAyaad C Sept. 2, 2020, 3:57 a.m. OK GNU C++17 TESTS 20 46 819200
91576925 ashishdwi99 C Sept. 1, 2020, 3 p.m. OK GNU C++17 TESTS 20 46 819200
91557136 JunSH C Sept. 1, 2020, 10:40 a.m. OK GNU C++17 TESTS 20 46 819200
91552254 zxcv_1 C Sept. 1, 2020, 9:22 a.m. OK GNU C++17 TESTS 20 46 819200
91549831 CSU_WJJJ C Sept. 1, 2020, 8:45 a.m. OK GNU C++17 TESTS 20 46 819200
91524716 p4lacios C Aug. 31, 2020, 9:23 p.m. OK GNU C++17 TESTS 20 46 819200
91132235 antguz C Aug. 27, 2020, 12:24 p.m. OK GNU C++17 (64) TESTS 20 31 819200
91287000 _USikka C Aug. 29, 2020, 1:18 p.m. OK GNU C++17 (64) TESTS 20 31 1843200
91289070 caeious C Aug. 29, 2020, 1:47 p.m. OK GNU C++17 (64) TESTS 20 31 2048000
91272871 WiwiHo C Aug. 29, 2020, 9:35 a.m. OK GNU C++17 (64) TESTS 20 46 819200
91594040 timreizin C Sept. 1, 2020, 6:52 p.m. OK GNU C++17 (64) TESTS 20 46 819200
91625625 sharrad99 C Sept. 2, 2020, 8:49 a.m. OK GNU C++17 (64) TESTS 20 46 819200
91687954 it_aint_me C Sept. 3, 2020, 5:04 a.m. OK GNU C++17 (64) TESTS 20 46 819200
91587278 ArtemGucci C Sept. 1, 2020, 5:07 p.m. OK GNU C++17 (64) TESTS 20 46 819200
91541657 Kodaman C Sept. 1, 2020, 6:40 a.m. OK GNU C++17 (64) TESTS 20 46 819200
91298161 elyutin159164 C Aug. 29, 2020, 4:10 p.m. OK GNU C++17 (64) TESTS 20 46 819200
91092160 pema4 C Aug. 26, 2020, 9:40 p.m. OK Haskell TESTS 20 249 22118400
91052582 B_w_c C Aug. 26, 2020, 12:51 p.m. OK Haskell TESTS 20 342 25292800
91676393 Ste C Sept. 2, 2020, 10:06 p.m. OK Java 11 TESTS 20 187 0
91128951 DR.KOKS C Aug. 27, 2020, 11:38 a.m. OK Java 11 TESTS 20 202 0
90814511 ssd17 C Aug. 24, 2020, 10 a.m. OK Java 11 TESTS 20 202 24064000
91128578 DR.KOKS C Aug. 27, 2020, 11:33 a.m. OK Java 11 TESTS 20 217 0
91019415 virendra_12 C Aug. 26, 2020, 5:28 a.m. OK Java 11 TESTS 20 218 2457600
91088072 amit_chas C Aug. 26, 2020, 7:48 p.m. OK Java 11 TESTS 20 233 8601600
91625820 Oort. C Sept. 2, 2020, 8:52 a.m. OK Java 11 TESTS 20 249 0
91544785 Prateek_Jakhar C Sept. 1, 2020, 7:29 a.m. OK Java 11 TESTS 20 249 0
91277552 nagu-pm C Aug. 29, 2020, 10:46 a.m. OK Java 11 TESTS 20 249 0
91087292 codingIsFun1234 C Aug. 26, 2020, 7:31 p.m. OK Java 11 TESTS 20 264 0
91309995 zodiacleo C Aug. 29, 2020, 7:55 p.m. OK Java 8 TESTS 20 124 0
91015884 Homie_smk C Aug. 26, 2020, 4:22 a.m. OK Java 8 TESTS 20 139 0
91093040 Nirav412000 C Aug. 26, 2020, 10:16 p.m. OK Java 8 TESTS 20 139 0
91016199 Homie_smk C Aug. 26, 2020, 4:29 a.m. OK Java 8 TESTS 20 139 0
91662834 noobspotted C Sept. 2, 2020, 5:19 p.m. OK Java 8 TESTS 20 140 0
91557069 OnFireVivek C Sept. 1, 2020, 10:38 a.m. OK Java 8 TESTS 20 140 0
91015929 Homie_smk C Aug. 26, 2020, 4:23 a.m. OK Java 8 TESTS 20 140 0
91015805 Homie_smk C Aug. 26, 2020, 4:20 a.m. OK Java 8 TESTS 20 140 0
91015700 Homie_smk C Aug. 26, 2020, 4:17 a.m. OK Java 8 TESTS 20 140 0
90871839 abhi456tm C Aug. 25, 2020, 5:59 a.m. OK Java 8 TESTS 20 140 0
91009628 Spheniscine C Aug. 26, 2020, 1:44 a.m. OK Kotlin TESTS 20 171 1126400
90827661 dkozak94 C Aug. 24, 2020, 1:04 p.m. OK Kotlin TESTS 20 202 22732800
90896606 Mirimax C Aug. 25, 2020, 11:56 a.m. OK Kotlin TESTS 20 218 512000
91168992 treasuryonly C Aug. 27, 2020, 9:50 p.m. OK Mono C# TESTS 20 93 11673600
91040427 Dimon2305 C Aug. 26, 2020, 10:20 a.m. OK Mono C# TESTS 20 124 16486400
91337554 hhsaffar C Aug. 30, 2020, 11:23 a.m. OK Mono C# TESTS 20 124 26521600
91139509 MiuraMiuMiu C Aug. 27, 2020, 2:07 p.m. OK Mono C# TESTS 20 530 15155200
91133998 HouraiNingyou C Aug. 27, 2020, 12:50 p.m. OK MS C++ 2017 TESTS 20 61 819200
91582886 shebao C Sept. 1, 2020, 4:11 p.m. OK MS C++ 2017 TESTS 20 62 1024000
91134121 HouraiNingyou C Aug. 27, 2020, 12:52 p.m. OK MS C++ 2017 TESTS 20 77 819200
91134145 HouraiNingyou C Aug. 27, 2020, 12:52 p.m. OK MS C++ 2017 TESTS 20 77 819200
90900386 polahovskaya C Aug. 25, 2020, 12:50 p.m. OK MS C++ 2017 TESTS 20 108 819200
91154257 ustaritz C Aug. 27, 2020, 4:59 p.m. OK MS C++ 2017 TESTS 20 109 819200
91553801 conserv C Sept. 1, 2020, 9:47 a.m. OK MS C++ 2017 TESTS 20 109 819200
91524929 Altaire13 C Aug. 31, 2020, 9:30 p.m. OK MS C++ 2017 TESTS 20 109 819200
90984835 bhanu2001 C Aug. 25, 2020, 4:40 p.m. OK MS C++ 2017 TESTS 20 109 819200
90863413 letshavesomefun C Aug. 25, 2020, 2:48 a.m. OK MS C++ 2017 TESTS 20 109 819200
91265232 mishagam C Aug. 29, 2020, 7:37 a.m. OK Ocaml TESTS 20 93 6963200
91521688 shadoX C Aug. 31, 2020, 7:58 p.m. OK PyPy 3 TESTS 20 187 9625600
91521832 shadoX C Aug. 31, 2020, 8:01 p.m. OK PyPy 3 TESTS 20 202 9523200
91521784 shadoX C Aug. 31, 2020, 8 p.m. OK PyPy 3 TESTS 20 202 9625600
91521743 shadoX C Aug. 31, 2020, 7:59 p.m. OK PyPy 3 TESTS 20 202 9625600
91521521 shadoX C Aug. 31, 2020, 7:54 p.m. OK PyPy 3 TESTS 20 202 9625600
91521723 shadoX C Aug. 31, 2020, 7:58 p.m. OK PyPy 3 TESTS 20 217 9625600
91127890 cpicard443 C Aug. 27, 2020, 11:23 a.m. OK PyPy 3 TESTS 20 249 11571200
90851048 raymonzhang20 C Aug. 24, 2020, 6:04 p.m. OK PyPy 3 TESTS 20 264 10444800
91225627 Abheet_007 C Aug. 28, 2020, 4:02 p.m. OK PyPy 3 TESTS 20 264 10854400
90861364 MR_MECHANICAL C Aug. 25, 2020, 1:30 a.m. OK PyPy 3 TESTS 20 264 13516800
91563751 qeatzy C Sept. 1, 2020, 12:14 p.m. OK Python 3 TESTS 20 155 7577600
91297370 the_distortion C Aug. 29, 2020, 3:57 p.m. OK Python 3 TESTS 20 156 8192000
91143814 ByMykel C Aug. 27, 2020, 2:57 p.m. OK Python 3 TESTS 20 156 8192000
91160383 simran145 C Aug. 27, 2020, 6:24 p.m. OK Python 3 TESTS 20 156 9523200
91524129 lichacuq C Aug. 31, 2020, 9:02 p.m. OK Python 3 TESTS 20 186 8704000
91067601 srishti99 C Aug. 26, 2020, 3:17 p.m. OK Python 3 TESTS 20 187 9011200
91204537 sudarshanvm C Aug. 28, 2020, 11:49 a.m. OK Python 3 TESTS 20 202 8192000
90985981 proniloy0 C Aug. 25, 2020, 4:46 p.m. OK Python 3 TESTS 20 202 8396800
91140242 Tkech C Aug. 27, 2020, 2:17 p.m. OK Python 3 TESTS 20 202 8499200
91648965 Quicksnipe C Sept. 2, 2020, 2:23 p.m. OK Python 3 TESTS 20 202 8806400
91283287 Rara. C Aug. 29, 2020, 12:16 p.m. OK Ruby TESTS 20 623 9625600
91228529 lordpawel C Aug. 28, 2020, 4:34 p.m. OK Ruby TESTS 20 717 9318400
91176730 unihernandez22 C Aug. 28, 2020, 3:32 a.m. OK Rust TESTS 20 93 4608000
91112250 Strorkis C Aug. 27, 2020, 7:28 a.m. OK Rust TESTS 20 124 3891200
91241290 pandrei C Aug. 28, 2020, 7:53 p.m. OK Rust TESTS 20 124 5632000

remove filters

Back to search problems