Codeforces Round 879 (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
1834 Codeforces Round 879 (Div. 2) FINISHED False 7200 44747699 June 18, 2023, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2291 ) E MEX of LCM PROGRAMMING binary search brute force data structures implementation math number theory two pointers

B'You are given an array a of length n . A positive integer x is called good if it is impossible to find a subsegment ^{ dagger} of the array such that the least common multiple of all its elements is equal to x . You need to find the smallest good integer. A subsegment ^{ dagger} of the array a is a set of elements a_l, a_{l + 1}, ldots, a_r for some 1 <= l <= r <= n . We will denote such subsegment as [l, r] . Each test consists of multiple test cases. The first line of each test case contains a single integer t ( 1 <= t <= 5 cdot 10^4 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 3 cdot 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots , a_n ( 1 <= q a_i <= q 10^9 ) -- the elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 3 cdot 10^5 . For each test case, output a single integer -- the smallest good integer. In the first test case, 4 is a good integer, and it is the smallest one, since the integers 1,2,3 appear in the array, which means that there are subsegments of the array of length 1 with least common multiples of 1,2,3 . However, it is impossible to find a subsegment of the array with a least common multiple equal to 4 . In the second test case, 7 is a good integer. The integers 1,2,3,4,5 appear explicitly in the array, and the integer 6 is the least common multiple of the subsegments [2, 3] and [1, 3] . In the third test case, 1 is a good integer, since the least common multiples for the integer in the subsegments [1, 1], [1, 2], [2, 2] are 2,6,3 , respectively. '...

Tutorials

Codeforces Round #879 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
210074442 KumaTachiRen E June 18, 2023, 9:40 a.m. OK C# 8 TESTS 21 248 29696000
210080918 Junz_LJL E June 18, 2023, 10 a.m. OK GNU C++14 TESTS 21 156 48128000
210196040 KurashinaAsuka E June 19, 2023, 2:45 a.m. OK GNU C++14 TESTS 26 171 2662400
210090228 Schi2oid E June 18, 2023, 11:04 a.m. OK GNU C++14 TESTS 23 171 12390400
210094791 chzxlfw E June 18, 2023, 11:51 a.m. OK GNU C++14 TESTS 24 171 16384000
210088628 Junz_LJL E June 18, 2023, 10:49 a.m. OK GNU C++14 TESTS 23 171 37273600
210088927 Schi2oid E June 18, 2023, 10:51 a.m. OK GNU C++14 TESTS 23 186 12595200
210108900 lmf_up E June 18, 2023, 2:24 p.m. OK GNU C++14 TESTS 26 187 2969600
210135810 CWJ_123 E June 18, 2023, 3:19 p.m. OK GNU C++14 TESTS 26 202 25395200
210100642 paul2008 E June 18, 2023, 12:54 p.m. OK GNU C++14 TESTS 26 233 17408000
210085878 Ice_teapoy E June 18, 2023, 10:28 a.m. OK GNU C++14 TESTS 21 312 15974400
210084008 rqoi032 E June 18, 2023, 10:18 a.m. OK GNU C++17 TESTS 21 93 43622400
210081588 rqoi032 E June 18, 2023, 10:02 a.m. OK GNU C++17 TESTS 21 109 43622400
210191602 NKheyuxiang E June 19, 2023, 12:48 a.m. OK GNU C++17 TESTS 26 109 53760000
210084808 aziiiiii E June 18, 2023, 10:22 a.m. OK GNU C++17 TESTS 21 140 240435200
210075074 amirhoseinfar1385 E June 18, 2023, 9:42 a.m. OK GNU C++17 TESTS 21 171 11878400
210194877 HarperTaylor E June 19, 2023, 2:19 a.m. OK GNU C++17 TESTS 26 171 13824000
210175788 archiver E June 18, 2023, 6:25 p.m. OK GNU C++17 TESTS 26 187 2150400
210093426 drome E June 18, 2023, 11:37 a.m. OK GNU C++17 TESTS 23 202 12185600
210094047 kefaa E June 18, 2023, 11:43 a.m. OK GNU C++17 TESTS 24 202 40960000
210095585 Myrcella E June 18, 2023, 11:59 a.m. OK GNU C++17 TESTS 24 202 62873600
210101232 __now__or__never__ E June 18, 2023, 1 p.m. OK GNU C++17 (64) TESTS 26 108 3174400
210096620 Linver E June 18, 2023, 12:10 p.m. OK GNU C++17 (64) TESTS 24 124 1331200
210096537 Linver E June 18, 2023, 12:09 p.m. OK GNU C++17 (64) TESTS 24 124 1638400
210094364 PEKKA_l E June 18, 2023, 11:47 a.m. OK GNU C++17 (64) TESTS 24 124 68812800
210109375 SHHK_test E June 18, 2023, 2:29 p.m. OK GNU C++17 (64) TESTS 26 139 37273600
210096599 Linver E June 18, 2023, 12:09 p.m. OK GNU C++17 (64) TESTS 24 140 1433600
210090423 _chroneZ E June 18, 2023, 11:05 a.m. OK GNU C++17 (64) TESTS 23 140 25292800
210090388 _chroneZ E June 18, 2023, 11:05 a.m. OK GNU C++17 (64) TESTS 23 140 25292800
210088758 _chroneZ E June 18, 2023, 10:50 a.m. OK GNU C++17 (64) TESTS 23 140 25292800
210087978 luanmenglei E June 18, 2023, 10:43 a.m. OK GNU C++17 (64) TESTS 23 171 25292800
210099544 kostylevGO E June 18, 2023, 12:41 p.m. OK GNU C++20 (64) TESTS 26 46 34201600
210198136 FoolestBoy E June 19, 2023, 3:31 a.m. OK GNU C++20 (64) TESTS 26 78 11264000
210097921 kostylevGO E June 18, 2023, 12:23 p.m. OK GNU C++20 (64) TESTS 25 78 34099200
210083847 Iam1789 E June 18, 2023, 10:17 a.m. OK GNU C++20 (64) TESTS 21 93 9625600
210095774 SATSKY E June 18, 2023, 12:01 p.m. OK GNU C++20 (64) TESTS 24 93 12083200
210078624 b8L1 E June 18, 2023, 9:53 a.m. OK GNU C++20 (64) TESTS 21 108 9625600
210090993 brenner1 E June 18, 2023, 11:11 a.m. OK GNU C++20 (64) TESTS 23 109 3686400
210077237 dOwOb E June 18, 2023, 9:49 a.m. OK GNU C++20 (64) TESTS 21 109 5529600
210094018 sukabulie E June 18, 2023, 11:43 a.m. OK GNU C++20 (64) TESTS 24 109 7270400
210077239 vgtcross E June 18, 2023, 9:49 a.m. OK GNU C++20 (64) TESTS 21 109 9932800
210078356 earl_of_byteland E June 18, 2023, 9:52 a.m. OK Java 17 TESTS 21 467 24985600
210098892 v7fgg E June 18, 2023, 12:34 p.m. OK Java 17 TESTS 26 873 59289600
210082180 cc4414 E June 18, 2023, 10:03 a.m. OK Java 8 TESTS 21 1216 100761600
210186684 SlavaG E June 18, 2023, 9:53 p.m. OK Kotlin 1.7 TESTS 26 1372 282828800
210186771 SlavaG E June 18, 2023, 9:57 p.m. OK Kotlin 1.7 TESTS 26 1388 259379200
210091689 424479543 E June 18, 2023, 11:18 a.m. OK PyPy 3-64 TESTS 23 265 38092800
210089816 huangxw E June 18, 2023, 11 a.m. OK PyPy 3-64 TESTS 23 280 40960000
210076459 ZrjaK E June 18, 2023, 9:46 a.m. OK PyPy 3-64 TESTS 21 374 41676800
210107044 yingkui E June 18, 2023, 2:07 p.m. OK PyPy 3-64 TESTS 26 405 41472000
210085076 LaPluma E June 18, 2023, 10:23 a.m. OK PyPy 3-64 TESTS 21 483 51507200
210090784 Little_Sheep_Yawn E June 18, 2023, 11:09 a.m. OK PyPy 3-64 TESTS 23 498 49868800
210085763 liupengsay E June 18, 2023, 10:27 a.m. OK PyPy 3-64 TESTS 21 499 43110400
210095109 LaPluma E June 18, 2023, 11:54 a.m. OK PyPy 3-64 TESTS 24 514 45260800
210095191 LaPluma E June 18, 2023, 11:55 a.m. OK PyPy 3-64 TESTS 24 530 53964800
210094926 LaPluma E June 18, 2023, 11:52 a.m. OK PyPy 3-64 TESTS 24 576 46284800
210080589 YummyPie E June 18, 2023, 9:59 a.m. OK Rust 2021 TESTS 21 265 21708800
210082106 cpchenpi E June 18, 2023, 10:03 a.m. OK Rust 2021 TESTS 21 312 57241600

remove filters

Back to search problems