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 |
---|---|---|---|---|---|---|
1980 | Codeforces Round 950 (Div. 3) | FINISHED | False | 8100 | 19754663 | June 3, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 14840 ) | D | GCD-sequence | PROGRAMMING | greedy implementation math math number theory number theory |
B'GCD (Greatest Common Divisor) of two integers x and y is the maximum integer z by which both x and y are divisible. For example, GCD(36, 48) = 12 , GCD(5, 10) = 5 , and GCD(7,11) = 1 . Kristina has an array a consisting of exactly n positive integers. She wants to count the GCD of each neighbouring pair of numbers to get a new array b , called GCD-sequence. So, the elements of the GCD-sequence b will be calculated using the formula b_i = GCD(a_i, a_{i + 1}) for 1 <= i <= n - 1 . Determine whether it is possible to remove exactly one number from the array a so that the GCD sequence b is non-decreasing (i.e., b_i <= b_{i+1} is always true). For example, let Khristina had an array a = [ 20, 6, 12, 3, 48, 36 ]. If she removes a_4 = 3 from it and counts the GCD-sequence of b , she gets: The first line of input data contains a single number t ( 1 <= t <= 10^4 ) -- he number of test cases in the test. This is followed by the descriptions of the test cases. The first line of each test case contains a single integer n ( 3 <= n <= 2 cdot 10^5 ) -- the number of elements in the array a . The second line of each test case contains exactly n integers a_i ( 1 <= a_i <= 10^9 ) -- the elements of array a . It is guaranteed that the sum of n over all test case does not exceed 2 cdot 10^5 . For each test case, output a single line: You can output the answer in any case (for example, the strings "yEs", "yes", "Yes", and "YES" will all be recognized as a positive answer). The first test case is explained in the problem statement. '... |
130135 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
264037603 | bati06 | D | June 3, 2024, 5:22 p.m. | OK | C# 10 | TESTS | 6 | 139 | 26009600 | ||
264068128 | A1ternate | D | June 4, 2024, 1:24 a.m. | OK | C# 10 | TESTS | 6 | 140 | 21196800 | ||
264043802 | tajwarul | D | June 3, 2024, 6:15 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
264038730 | NotBaimaokong | D | June 3, 2024, 5:30 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
264033715 | 3ly_tany_khales | D | June 3, 2024, 5:01 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
264073973 | sameer_shreyas | D | June 4, 2024, 3:07 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 78 | 0 | ||
264035510 | Wi_Es | D | June 3, 2024, 5:10 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 78 | 0 | ||
264044991 | ddlmedialuna | D | June 3, 2024, 6:25 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 78 | 1126400 | ||
264042754 | __Anvith__ | D | June 3, 2024, 6:06 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 92 | 0 | ||
264062446 | Rombing | D | June 3, 2024, 10:35 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 92 | 4812800 | ||
264081213 | akshath07 | D | June 4, 2024, 4:56 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 93 | 0 | ||
264062869 | EndymionMo | D | June 3, 2024, 10:48 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 93 | 0 | ||
264075018 | Obiwan114 | D | June 4, 2024, 3:25 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
264059979 | Shoaib_Anwar | D | June 3, 2024, 9:36 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
264053781 | sumon_ahmed | D | June 3, 2024, 8 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
264080154 | CandySanjo | D | June 4, 2024, 4:43 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 77 | 0 | ||
264079418 | tonmoy1912 | D | June 4, 2024, 4:34 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 77 | 0 | ||
264075401 | ajaypaliwal | D | June 4, 2024, 3:31 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 77 | 0 | ||
264074076 | marisa3 | D | June 4, 2024, 3:09 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 77 | 0 | ||
264072194 | NoLimitation | D | June 4, 2024, 2:36 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 77 | 0 | ||
264067305 | movaa | D | June 4, 2024, 1:01 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 77 | 0 | ||
264064257 | pm.pratyush_23 | D | June 3, 2024, 11:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 77 | 0 | ||
264076786 | hhhyh | D | June 4, 2024, 3:53 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
264074511 | Rapids | D | June 4, 2024, 3:17 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
264076208 | Talent_Camellia | D | June 4, 2024, 3:44 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264068315 | xyktyjayket | D | June 4, 2024, 1:28 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264068196 | Awith | D | June 4, 2024, 1:25 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264067764 | pppwolf | D | June 4, 2024, 1:14 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264065502 | enslaved | D | June 4, 2024, 12:07 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264051377 | PROhan | D | June 3, 2024, 7:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264049466 | malkhuzanie | D | June 3, 2024, 7:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264043233 | TEFA | D | June 3, 2024, 6:10 p.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 62 | 0 | ||
264034361 | ruban | D | June 3, 2024, 5:04 p.m. | OK | Delphi | TESTS | 6 | 78 | 50688000 | ||
264042651 | Szzzp | D | June 3, 2024, 6:05 p.m. | OK | GNU C11 | TESTS | 6 | 77 | 4812800 | ||
264059642 | vikash_45 | D | June 3, 2024, 9:29 p.m. | OK | Java 21 | TESTS | 6 | 265 | 5632000 | ||
264060114 | ItsLever | D | June 3, 2024, 9:39 p.m. | OK | Java 21 | TESTS | 6 | 265 | 5734400 | ||
264074192 | Xing_ke | D | June 4, 2024, 3:11 a.m. | OK | Java 21 | TESTS | 6 | 296 | 5017600 | ||
264075493 | yang_wei | D | June 4, 2024, 3:33 a.m. | OK | Java 21 | TESTS | 6 | 311 | 0 | ||
264040044 | Eslam_Ahmed | D | June 3, 2024, 5:41 p.m. | OK | Java 21 | TESTS | 6 | 327 | 4403200 | ||
264044247 | aspgarv112 | D | June 3, 2024, 6:19 p.m. | OK | Java 21 | TESTS | 6 | 327 | 8192000 | ||
264038395 | Edge_Tree | D | June 3, 2024, 5:28 p.m. | OK | Java 21 | TESTS | 6 | 327 | 42086400 | ||
264060393 | tushar19280 | D | June 3, 2024, 9:46 p.m. | OK | Java 21 | TESTS | 6 | 327 | 82636800 | ||
264046005 | dinosparton_013 | D | June 3, 2024, 6:34 p.m. | OK | Java 21 | TESTS | 6 | 343 | 8704000 | ||
264074152 | minibin | D | June 4, 2024, 3:10 a.m. | OK | Java 21 | TESTS | 6 | 359 | 7680000 | ||
264079083 | achyut88 | D | June 4, 2024, 4:28 a.m. | OK | Java 8 | TESTS | 6 | 218 | 11980800 | ||
264050736 | SweetAsCocaine | D | June 3, 2024, 7:24 p.m. | OK | Java 8 | TESTS | 6 | 218 | 13516800 | ||
264079333 | NayanVerma14 | D | June 4, 2024, 4:33 a.m. | OK | Java 8 | TESTS | 6 | 233 | 13516800 | ||
264033753 | FirstException | D | June 3, 2024, 5:01 p.m. | OK | Java 8 | TESTS | 6 | 249 | 68608000 | ||
264047156 | Yousef_Badr | D | June 3, 2024, 6:46 p.m. | OK | Java 8 | TESTS | 6 | 328 | 16281600 | ||
264045872 | faresbadr316 | D | June 3, 2024, 6:33 p.m. | OK | Java 8 | TESTS | 6 | 343 | 16281600 | ||
264079482 | jiminaseinen | D | June 4, 2024, 4:35 a.m. | OK | Java 8 | TESTS | 6 | 343 | 43724800 | ||
264079403 | hanekaeru | D | June 4, 2024, 4:34 a.m. | OK | Java 8 | TESTS | 6 | 343 | 43724800 | ||
264077010 | dauletomarov1130 | D | June 4, 2024, 3:56 a.m. | OK | Java 8 | TESTS | 6 | 405 | 0 | ||
264042979 | yash_7xm | D | June 3, 2024, 6:08 p.m. | OK | Java 8 | TESTS | 6 | 437 | 0 | ||
264052293 | aayush.mishra | D | June 3, 2024, 7:41 p.m. | OK | Kotlin 1.9 | TESTS | 6 | 468 | 16384000 | ||
264040733 | Westin_sheep | D | June 3, 2024, 5:47 p.m. | OK | PyPy 3 | TESTS | 6 | 358 | 18432000 | ||
264082995 | WW416 | D | June 4, 2024, 5:16 a.m. | OK | PyPy 3 | TESTS | 13 | 374 | 19558400 | ||
264034233 | lo_krlo_baatt | D | June 3, 2024, 5:03 p.m. | OK | PyPy 3 | TESTS | 6 | 531 | 24883200 | ||
264036578 | deenium | D | June 3, 2024, 5:16 p.m. | OK | PyPy 3-64 | TESTS | 6 | 140 | 33280000 | ||
264053961 | gardengnome | D | June 3, 2024, 8:02 p.m. | OK | PyPy 3-64 | TESTS | 6 | 155 | 26931200 | ||
264054165 | ntarsis30 | D | June 3, 2024, 8:05 p.m. | OK | PyPy 3-64 | TESTS | 6 | 155 | 35430400 | ||
264036562 | S-DPR | D | June 3, 2024, 5:16 p.m. | OK | PyPy 3-64 | TESTS | 6 | 156 | 28467200 | ||
264056885 | kibr | D | June 3, 2024, 8:41 p.m. | OK | PyPy 3-64 | TESTS | 6 | 171 | 30412800 | ||
264032272 | kibrnew | D | June 3, 2024, 4:54 p.m. | OK | PyPy 3-64 | TESTS | 6 | 171 | 30412800 | ||
264051841 | EccentricRaccoon | D | June 3, 2024, 7:36 p.m. | OK | PyPy 3-64 | TESTS | 6 | 171 | 36556800 | ||
264067755 | USYDLDH | D | June 4, 2024, 1:14 a.m. | OK | PyPy 3-64 | TESTS | 6 | 171 | 40345600 | ||
264073612 | samchen123 | D | June 4, 2024, 3:01 a.m. | OK | PyPy 3-64 | TESTS | 6 | 186 | 27238400 | ||
264073700 | samchen123 | D | June 4, 2024, 3:02 a.m. | OK | PyPy 3-64 | TESTS | 6 | 186 | 27443200 | ||
264042601 | MTA9402 | D | June 3, 2024, 6:04 p.m. | OK | Python 3 | TESTS | 6 | 187 | 26419200 | ||
264040886 | FREEDOMTOFAIL | D | June 3, 2024, 5:48 p.m. | OK | Python 3 | TESTS | 6 | 218 | 26316800 | ||
264048757 | OLOGY | D | June 3, 2024, 7:03 p.m. | OK | Python 3 | TESTS | 6 | 218 | 27545600 | ||
264050101 | OLOGY | D | June 3, 2024, 7:17 p.m. | OK | Python 3 | TESTS | 6 | 233 | 25907200 | ||
264034846 | MdNazmulHossain | D | June 3, 2024, 5:06 p.m. | OK | Python 3 | TESTS | 6 | 249 | 25907200 | ||
264045518 | OLOGY | D | June 3, 2024, 6:30 p.m. | OK | Python 3 | TESTS | 6 | 280 | 25190400 | ||
264077558 | leelarishika | D | June 4, 2024, 4:05 a.m. | OK | Python 3 | TESTS | 6 | 280 | 25907200 | ||
264040164 | Chitru4 | D | June 3, 2024, 5:42 p.m. | OK | Python 3 | TESTS | 6 | 343 | 25907200 | ||
264034978 | saikiranreddymekala28 | D | June 3, 2024, 5:07 p.m. | OK | Python 3 | TESTS | 6 | 358 | 32870400 | ||
264040197 | Muhammad_Hamed | D | June 3, 2024, 5:42 p.m. | OK | Python 3 | TESTS | 6 | 421 | 30924800 | ||
264037218 | Kawaii | D | June 3, 2024, 5:20 p.m. | OK | Rust 2021 | TESTS | 6 | 62 | 4505600 | ||
264060325 | vstiff | D | June 3, 2024, 9:44 p.m. | OK | Rust 2021 | TESTS | 6 | 77 | 3276800 | ||
264037088 | Kawaii | D | June 3, 2024, 5:19 p.m. | OK | Rust 2021 | TESTS | 6 | 77 | 4403200 | ||
264053415 | robchik | D | June 3, 2024, 7:55 p.m. | OK | Rust 2021 | TESTS | 6 | 77 | 14540800 | ||
264044774 | namitnayan | D | June 3, 2024, 6:24 p.m. | OK | Rust 2021 | TESTS | 6 | 93 | 14438400 |
Back to search problems