Codeforces Round 708 (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
1497 Codeforces Round 708 (Div. 2) FINISHED False 8100 121274663 March 17, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1774 ) E2 Square-free division (hard version) PROGRAMMING data structures dp greedy hashing math number theory 2500

B"This is the hard version of the problem. The only difference is that in this version 0 <= q k <= q 20 . There is an array a_1, a_2, ldots, a_n of n positive integers. You should divide it into a minimal number of continuous segments, such that in each segment there are no two numbers (on different positions), whose product is a perfect square. Moreover, it is allowed to do at most k such operations before the division: choose a number in the array and change its value to any positive integer. What is the minimum number of continuous segments you should use if you will make changes optimally? The first line contains a single integer t (1 <= t <= 1000) -- the number of test cases. The first line of each test case contains two integers n , k ( 1 <= n <= 2 cdot 10^5 , 0 <= q k <= q 20 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^7 ). It's guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case print a single integer -- the answer to the problem. In the first test case it is possible to change the array this way: [ underline{3}, 6, 2, 4, underline{5}] (changed elements are underlined). After that the array does not need to be divided, so the answer is 1 . In the second test case it is possible to change the array this way: [6, 2, underline{3}, 8, 9, underline{5}, 3, 6, underline{10}, underline{11}, 7] . After that such division is optimal: "...

Tutorials

Codeforces Round #708 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
110250082 rainboy E2 March 17, 2021, 6:08 p.m. OK GNU C11 TESTS 102 217 80998400 2500
110279245 Griezmann17 E2 March 18, 2021, 5:20 a.m. OK GNU C++11 TESTS 102 249 156364800 2500
110279929 little_brush E2 March 18, 2021, 5:30 a.m. OK GNU C++11 TESTS 102 280 122675200 2500
110275283 hangyesheng E2 March 18, 2021, 4:14 a.m. OK GNU C++11 TESTS 102 295 156364800 2500
110270985 xajd1906 E2 March 18, 2021, 2:46 a.m. OK GNU C++11 TESTS 102 342 164761600 2500
110270242 lcyxds E2 March 18, 2021, 2:27 a.m. OK GNU C++11 TESTS 102 358 114585600 2500
110273613 Hau E2 March 18, 2021, 3:40 a.m. OK GNU C++11 TESTS 102 358 121036800 2500
110268417 limpid E2 March 18, 2021, 1:26 a.m. OK GNU C++11 TESTS 102 373 154726400 2500
110274135 OMG_link E2 March 18, 2021, 3:50 a.m. OK GNU C++11 TESTS 102 374 122470400 2500
110276476 qingyuforever E2 March 18, 2021, 4:37 a.m. OK GNU C++11 TESTS 102 405 145920000 2500
110270770 dlx_c E2 March 18, 2021, 2:41 a.m. OK GNU C++11 TESTS 102 436 94208000 2500
110265878 AMnu E2 March 17, 2021, 11:40 p.m. OK GNU C++14 TESTS 102 280 129024000 2500
110263888 Uchiha.Itachi E2 March 17, 2021, 10:14 p.m. OK GNU C++14 TESTS 102 358 47411200 2500
110263908 Uchiha.Itachi E2 March 17, 2021, 10:15 p.m. OK GNU C++14 TESTS 102 374 47411200 2500
110243815 dlalswp25 E2 March 17, 2021, 4:35 p.m. OK GNU C++14 TESTS 101 374 109158400 2500
110249789 aditi062519 E2 March 17, 2021, 6:06 p.m. OK GNU C++14 TESTS 102 451 64000000 2500
110266652 xwd654 E2 March 18, 2021, 12:16 a.m. OK GNU C++14 TESTS 102 483 103628800 2500
110256277 jainbot27 E2 March 17, 2021, 7:17 p.m. OK GNU C++14 TESTS 102 529 91955200 2500
110271592 BY_KUTBILIM E2 March 18, 2021, 2:54 a.m. OK GNU C++14 TESTS 102 529 128716800 2500
110269940 heyuhhh E2 March 18, 2021, 2:18 a.m. OK GNU C++14 TESTS 102 608 97996800 2500
110270191 Tovarisch E2 March 18, 2021, 2:25 a.m. OK GNU C++14 TESTS 102 623 161894400 2500
110244884 ApheIios E2 March 17, 2021, 4:39 p.m. OK GNU C++17 TESTS 101 202 75366400 2500
110272900 zzdrws E2 March 18, 2021, 3:24 a.m. OK GNU C++17 TESTS 102 295 32256000 2500
110264898 gevacrt E2 March 17, 2021, 10:59 p.m. OK GNU C++17 TESTS 102 296 29696000 2500
110274903 zzdrws E2 March 18, 2021, 4:06 a.m. OK GNU C++17 TESTS 102 311 32256000 2500
110270328 SaoST E2 March 18, 2021, 2:29 a.m. OK GNU C++17 TESTS 102 311 202854400 2500
110272678 zzdrws E2 March 18, 2021, 3:20 a.m. OK GNU C++17 TESTS 102 312 32256000 2500
110271933 cjoa E2 March 18, 2021, 3:03 a.m. OK GNU C++17 TESTS 102 343 74342400 2500
110262680 Fubuki_AI E2 March 17, 2021, 9:31 p.m. OK GNU C++17 TESTS 102 358 125644800 2500
110243622 alegsandyr E2 March 17, 2021, 4:34 p.m. OK GNU C++17 TESTS 101 374 100147200 2500
110269111 QZSRY E2 March 18, 2021, 1:51 a.m. OK GNU C++17 TESTS 102 389 154726400 2500
110246493 TYpeWriting E2 March 17, 2021, 4:46 p.m. OK GNU C++17 (64) TESTS 101 156 36761600 2500
110272875 777 E2 March 18, 2021, 3:24 a.m. OK GNU C++17 (64) TESTS 102 233 105164800 2500
110245220 iamnifer E2 March 17, 2021, 4:40 p.m. OK GNU C++17 (64) TESTS 101 249 91750400 2500
110256772 iamnifer E2 March 17, 2021, 7:25 p.m. OK GNU C++17 (64) TESTS 102 249 95948800 2500
110273599 balbit E2 March 18, 2021, 3:40 a.m. OK GNU C++17 (64) TESTS 102 265 59187200 2500
110251334 neal E2 March 17, 2021, 6:18 p.m. OK GNU C++17 (64) TESTS 102 280 72192000 2500
110243288 kotatsugame E2 March 17, 2021, 4:33 p.m. OK GNU C++17 (64) TESTS 101 280 87961600 2500
110256547 iamnifer E2 March 17, 2021, 7:21 p.m. OK GNU C++17 (64) TESTS 102 280 91750400 2500
110256488 iamnifer E2 March 17, 2021, 7:20 p.m. OK GNU C++17 (64) TESTS 102 280 91750400 2500
110282233 Zztrans E2 March 18, 2021, 6:01 a.m. OK GNU C++17 (64) TESTS 102 296 58982400 2500
110257375 Dukkha E2 March 17, 2021, 7:34 p.m. OK Java 11 TESTS 102 436 112742400 2500
110256194 Dukkha E2 March 17, 2021, 7:16 p.m. OK Java 11 TESTS 102 701 112742400 2500
110279746 Friska E2 March 18, 2021, 5:27 a.m. OK MS C++ 2017 TESTS 102 608 58982400 2500
110263893 jimm89 E2 March 17, 2021, 10:14 p.m. OK PyPy 3 TESTS 102 1184 144281600 2500
110263823 jimm89 E2 March 17, 2021, 10:11 p.m. OK PyPy 3 TESTS 102 1248 148070400 2500
110261665 hxu10 E2 March 17, 2021, 9 p.m. OK PyPy 3 TESTS 102 1965 99225600 2500
110261251 hxu10 E2 March 17, 2021, 8:49 p.m. OK PyPy 3 TESTS 102 1980 99430400 2500
110243194 toomer E2 March 17, 2021, 4:32 p.m. OK Rust TESTS 101 467 54886400 2500
110251477 hiratai E2 March 17, 2021, 6:19 p.m. OK Rust TESTS 102 1075 30822400 2500
110250893 hiratai E2 March 17, 2021, 6:14 p.m. OK Rust TESTS 102 1216 32768000 2500
110250593 hiratai E2 March 17, 2021, 6:12 p.m. OK Rust TESTS 102 1247 32768000 2500

remove filters

Back to search problems