Codeforces Round 948 (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
1977 Codeforces Round 948 (Div. 2) FINISHED False 7200 20445863 May 26, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6952 ) C Nikita and LCM PROGRAMMING brute force data structures dp greedy math number theory sortings 1900

B'Nikita is a student passionate about number theory and algorithms. He faces an interesting problem related to an array of numbers. Suppose Nikita has an array of integers a of length n . He will call a subsequence ^ dagger of the array special if its least common multiple (LCM) is not contained in a . The LCM of an empty subsequence is equal to 0 . Nikita wonders: what is the length of the longest special subsequence of a ? Help him answer this question! ^ dagger A sequence b is a subsequence of a if b can be obtained from a by the deletion of several (possibly, zero or all) elements, without changing the order of the remaining elements. For example, [5,2,3] is a subsequence of [1,5,7,8,2,4,3] . Each test contains multiple test cases. The first line of input contains a single integer t ( 1 <= t <= 2000 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 2000 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 2000 . For each test case, output a single integer -- the length of the longest special subsequence of a . In the first test case, the LCM of any non-empty subsequence is contained in a , so the answer is 0 . In the second test case, we can take the subsequence [3, 2, 10, 1] , its LCM is equal to 30 , which is not contained in a . In the third test case, we can take the subsequence [2, 3, 6, 100 ,003] , its LCM is equal to 600 ,018 , which is not contained in a . '...

Tutorials

129858

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
263089048 sarthak_tirpude C May 29, 2024, 5:19 a.m. OK C++14 (GCC 6-32) TESTS 29 77 0 1900
263107114 Simex C May 29, 2024, 7:55 a.m. OK C++14 (GCC 6-32) TESTS 29 77 204800 1900
263699774 mishrasatyam892 C June 2, 2024, 4:50 a.m. OK C++14 (GCC 6-32) TESTS 29 78 0 1900
263692020 Not_bie013 C June 2, 2024, 2:23 a.m. OK C++14 (GCC 6-32) TESTS 29 78 0 1900
263399742 liuqiang123 C May 31, 2024, 2:22 a.m. OK C++14 (GCC 6-32) TESTS 29 93 0 1900
262952135 gwf01 C May 28, 2024, 3:46 a.m. OK C++14 (GCC 6-32) TESTS 27 93 0 1900
262988766 AzZr_KZ C May 28, 2024, 9:32 a.m. OK C++14 (GCC 6-32) TESTS 27 93 8089600 1900
263032322 cabbage114514 C May 28, 2024, 3:27 p.m. OK C++14 (GCC 6-32) TESTS 27 109 921600 1900
263151887 Raigty C May 29, 2024, 1:56 p.m. OK C++14 (GCC 6-32) TESTS 29 140 0 1900
263026070 Raigty C May 28, 2024, 2:35 p.m. OK C++14 (GCC 6-32) TESTS 27 140 0 1900
263068060 s_singh18 C May 28, 2024, 10:07 p.m. OK C++17 (GCC 7-32) TESTS 27 61 0 1900
262978587 MarcusL C May 28, 2024, 8:05 a.m. OK C++17 (GCC 7-32) TESTS 27 61 102400 1900
263199781 rishendraT C May 30, 2024, 4:55 a.m. OK C++17 (GCC 7-32) TESTS 29 62 0 1900
263197946 vjudge.5 C May 30, 2024, 4:17 a.m. OK C++17 (GCC 7-32) TESTS 29 62 0 1900
263160492 LeDaiKing C May 29, 2024, 3:09 p.m. OK C++17 (GCC 7-32) TESTS 29 62 0 1900
263008871 warrenn C May 28, 2024, 12:20 p.m. OK C++17 (GCC 7-32) TESTS 27 62 0 1900
262982371 maiicy C May 28, 2024, 8:37 a.m. OK C++17 (GCC 7-32) TESTS 27 62 0 1900
263133884 chaos998 C May 29, 2024, 11:35 a.m. OK C++17 (GCC 7-32) TESTS 29 77 0 1900
263121107 cwz2024 C May 29, 2024, 9:48 a.m. OK C++17 (GCC 7-32) TESTS 29 77 0 1900
263065398 vipulv_codes C May 28, 2024, 9:12 p.m. OK C++17 (GCC 7-32) TESTS 27 77 0 1900
263194850 vjudge.8 C May 30, 2024, 2:46 a.m. OK C++20 (GCC 13-64) TESTS 29 62 0 1900
263194842 sword_ C May 30, 2024, 2:46 a.m. OK C++20 (GCC 13-64) TESTS 29 62 0 1900
263185486 camc C May 29, 2024, 9:12 p.m. OK C++20 (GCC 13-64) TESTS 29 62 0 1900
263185877 ChihoLam C May 29, 2024, 9:20 p.m. OK C++20 (GCC 13-64) TESTS 29 62 102400 1900
263177090 camc C May 29, 2024, 6:52 p.m. OK C++20 (GCC 13-64) TESTS 29 77 0 1900
263152448 jjo_ayt C May 29, 2024, 2 p.m. OK C++20 (GCC 13-64) TESTS 29 77 0 1900
263256674 XMUQ C May 30, 2024, 1:35 p.m. OK C++20 (GCC 13-64) TESTS 29 77 102400 1900
263649791 Taibo C June 1, 2024, 3:33 p.m. OK C++20 (GCC 13-64) TESTS 29 77 1638400 1900
263144440 Ceaser137 C May 29, 2024, 1 p.m. OK C++20 (GCC 13-64) TESTS 29 93 0 1900
263017064 AVAVA C May 28, 2024, 1:23 p.m. OK C++20 (GCC 13-64) TESTS 27 93 0 1900
262962529 fpccvn C May 28, 2024, 5:42 a.m. OK FPC TESTS 27 1108 1331200 1900
263431709 0x3F C May 31, 2024, 7:47 a.m. OK Go TESTS 29 577 204800 1900
263440018 nguyenquocthao00 C May 31, 2024, 9:01 a.m. OK Go TESTS 29 640 4915200 1900
263021220 Omar_Morsi C May 28, 2024, 1:57 p.m. OK Java 21 TESTS 27 468 614400 1900
263502088 himneesh9 C May 31, 2024, 1:04 p.m. OK Java 21 TESTS 29 515 512000 1900
263621006 d2s2 C June 1, 2024, 11:25 a.m. OK Java 21 TESTS 29 546 921600 1900
263069331 Pidjak C May 28, 2024, 10:39 p.m. OK Java 21 TESTS 27 562 716800 1900
263315531 whd_CN C May 30, 2024, 3:20 p.m. OK Java 21 TESTS 29 593 921600 1900
263502224 himneesh9 C May 31, 2024, 1:05 p.m. OK Java 21 TESTS 29 593 1638400 1900
262952780 yang_wei C May 28, 2024, 3:56 a.m. OK Java 21 TESTS 27 733 819200 1900
263008746 vansh_ag C May 28, 2024, 12:19 p.m. OK Java 21 TESTS 27 764 1536000 1900
263604280 Anupam720 C June 1, 2024, 9:12 a.m. OK Java 21 TESTS 29 765 614400 1900
263034887 duyipeng C May 28, 2024, 3:48 p.m. OK Java 21 TESTS 27 827 1638400 1900
263021534 4He3Liu1Shan.5Hu C May 28, 2024, 2 p.m. OK Java 8 TESTS 27 515 0 1900
263078368 Jha_coder1942 C May 29, 2024, 2:34 a.m. OK Java 8 TESTS 29 655 0 1900
263100333 Lakshay429 C May 29, 2024, 7:05 a.m. OK Java 8 TESTS 29 718 0 1900
263061779 wat2 C May 28, 2024, 8:12 p.m. OK Java 8 TESTS 27 780 6451200 1900
263104552 cmpunk.rockzz C May 29, 2024, 7:35 a.m. OK Java 8 TESTS 29 1030 0 1900
263026511 hanekaeru C May 28, 2024, 2:39 p.m. OK Java 8 TESTS 27 1062 0 1900
263023011 jiminaseinen C May 28, 2024, 2:11 p.m. OK Java 8 TESTS 27 1062 0 1900
263087233 cmpunk.rockzz C May 29, 2024, 4:56 a.m. OK Java 8 TESTS 29 1077 0 1900
263024049 hanekaeru C May 28, 2024, 2:20 p.m. OK Java 8 TESTS 27 1077 0 1900
263025224 hanekaeru C May 28, 2024, 2:29 p.m. OK Java 8 TESTS 27 1108 0 1900
263158875 KerakTelor C May 29, 2024, 2:54 p.m. OK Kotlin 1.9 TESTS 29 687 1638400 1900
263158775 KerakTelor C May 29, 2024, 2:53 p.m. OK Kotlin 1.9 TESTS 29 1093 1638400 1900
263623256 YMSeah C June 1, 2024, 11:42 a.m. OK PyPy 3 TESTS 29 499 5939200 1900
263261382 bunny_senpai C May 30, 2024, 2:13 p.m. OK PyPy 3 TESTS 29 718 6041600 1900
263259514 bunny_senpai C May 30, 2024, 1:58 p.m. OK PyPy 3 TESTS 29 1703 6041600 1900
263261122 bunny_senpai C May 30, 2024, 2:11 p.m. OK PyPy 3 TESTS 29 1811 6656000 1900
263260668 bunny_senpai C May 30, 2024, 2:07 p.m. OK PyPy 3 TESTS 29 1859 6041600 1900
263260296 bunny_senpai C May 30, 2024, 2:04 p.m. OK PyPy 3 TESTS 29 1874 5939200 1900
263087061 andr14142 C May 29, 2024, 4:54 a.m. OK PyPy 3-64 TESTS 29 202 5632000 1900
263530707 Anshu.. C May 31, 2024, 5:07 p.m. OK PyPy 3-64 TESTS 29 406 9420800 1900
263669190 VijayBalaji C June 1, 2024, 6:19 p.m. OK PyPy 3-64 TESTS 29 483 6144000 1900
263533334 ossau_guildo C May 31, 2024, 5:31 p.m. OK PyPy 3-64 TESTS 29 780 9625600 1900
263020477 mer_on C May 28, 2024, 1:52 p.m. OK PyPy 3-64 TESTS 27 812 6860800 1900
263627495 __bharat__ C June 1, 2024, 12:17 p.m. OK PyPy 3-64 TESTS 29 812 8601600 1900
262971701 sadqubit C May 28, 2024, 7:05 a.m. OK PyPy 3-64 TESTS 27 827 5324800 1900
263535524 notqc C May 31, 2024, 5:50 p.m. OK PyPy 3-64 TESTS 29 827 8704000 1900
263034601 MassimoG C May 28, 2024, 3:45 p.m. OK PyPy 3-64 TESTS 27 827 9216000 1900
263037151 DaniilKK C May 28, 2024, 4:06 p.m. OK PyPy 3-64 TESTS 27 842 6963200 1900
263257774 tarqulalamopi C May 30, 2024, 1:44 p.m. OK Python 3 TESTS 29 1452 204800 1900
263012454 prathamsibal81 C May 28, 2024, 12:48 p.m. OK Python 3 TESTS 27 1452 307200 1900
263217207 Sergey18 C May 30, 2024, 9:33 a.m. OK Python 3 TESTS 29 1453 307200 1900
263367942 _Demon_ C May 30, 2024, 5:21 p.m. OK Python 3 TESTS 29 1468 204800 1900
263530602 Anshu.. C May 31, 2024, 5:07 p.m. OK Python 3 TESTS 29 1499 0 1900
263414053 veera_teja_007 C May 31, 2024, 5:22 a.m. OK Python 3 TESTS 29 1577 204800 1900
263009019 hellobug_2 C May 28, 2024, 12:21 p.m. OK Rust 2021 TESTS 27 218 0 1900
263152671 DAlone C May 29, 2024, 2:02 p.m. OK Rust 2021 TESTS 29 234 0 1900
263069171 DeanMMenezes C May 28, 2024, 10:34 p.m. OK Rust 2021 TESTS 27 234 0 1900
263154019 DAlone C May 29, 2024, 2:13 p.m. OK Rust 2021 TESTS 29 249 0 1900
263204461 BetterThanNobita C May 30, 2024, 6:16 a.m. OK Rust 2021 TESTS 29 343 0 1900
263152430 bqn C May 29, 2024, 2 p.m. OK Rust 2021 TESTS 29 749 0 1900

remove filters

Back to search problems