Codeforces Round 861 (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
1808 Codeforces Round 861 (Div. 2) FINISHED False 7200 57099263 March 29, 2023, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2419 ) D Petya, Petya, Petr, and Palindromes PROGRAMMING binary search data structures two pointers 2100

B"Petya and his friend, the robot Petya++, have a common friend -- the cyborg Petr#. Sometimes Petr# comes to the friends for a cup of tea and tells them interesting problems. Today, Petr# told them the following problem. A palindrome is a sequence that reads the same from left to right as from right to left. For example, [38, 12, 8, 12, 38] , [1] , and [3, 8, 8, 3] are palindromes. Let's call the palindromicity of a sequence a_1, a_2, ... , a_n the minimum count of elements that need to be replaced to make this sequence a palindrome. For example, the palindromicity of the sequence [38, 12, 8, 38, 38] is 1 since it is sufficient to replace the number 38 at the fourth position with the number 12 . And the palindromicity of the sequence [3, 3, 5, 5, 5] is two since you can replace the first two threes with fives, and the resulting sequence [5, 5, 5, 5, 5] is a palindrome. Given a sequence a of length n , and an odd integer k , you need to find the sum of palindromicity of all subarrays of length k , i. e., the sum of the palindromicity values for the sequences a_i, a_{i+1}, ... , a_{i+k-1} for all i from 1 to n-k+1 . The students quickly solved the problem. Can you do it too? The first line of the input contains two integers n and k ( 1 <= n <= 2 cdot 10^5 , 1 <= k <= n , k is odd) -- the length of the sequence and the length of subarrays for which it is necessary to determine whether they are palindromes. The second line of the input contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 2 cdot 10^5 ) -- the sequence itself. Output a single integer -- the total palindromicity of all subarrays of length k . In the first example, the palindromicity of the subarray [1, 2, 8, 2, 5] is 1 , the palindromicity of the string [2, 8, 2, 5, 2] is also 1 , the palindromicity of the stri"...

Tutorials

Codeforces Round #861 (Div. 2) editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
199904467 robinyqc D March 31, 2023, 4:19 a.m. OK GNU C++14 TESTS 25 31 20787200 2100
199816423 LLX D March 30, 2023, 11:37 a.m. OK GNU C++14 TESTS 25 46 2457600 2100
199904274 robinyqc D March 31, 2023, 4:15 a.m. OK GNU C++14 TESTS 25 46 3993600 2100
199819716 Lucky_Glass D March 30, 2023, 12:06 p.m. OK GNU C++14 TESTS 25 61 1536000 2100
199919410 hhhyyyfff D March 31, 2023, 7:59 a.m. OK GNU C++14 TESTS 25 62 1638400 2100
199801320 wuyouka D March 30, 2023, 9:07 a.m. OK GNU C++14 TESTS 25 62 1638400 2100
199816561 LLX D March 30, 2023, 11:38 a.m. OK GNU C++14 TESTS 25 62 2457600 2100
199809362 xzr1729 D March 30, 2023, 10:32 a.m. OK GNU C++14 TESTS 25 62 2457600 2100
200067974 wdnmdwrnmmp D April 1, 2023, 3:28 a.m. OK GNU C++14 TESTS 25 62 3174400 2100
199826786 c20230139 D March 30, 2023, 1:08 p.m. OK GNU C++14 TESTS 25 77 12083200 2100
199903489 krijesnica D March 31, 2023, 3:59 a.m. OK GNU C++17 TESTS 25 46 3584000 2100
199829932 WrongAutomaton D March 30, 2023, 1:34 p.m. OK GNU C++17 TESTS 25 46 7987200 2100
199864824 czhang2718 D March 30, 2023, 5:33 p.m. OK GNU C++17 TESTS 25 61 2457600 2100
199843165 wym111 D March 30, 2023, 2:56 p.m. OK GNU C++17 TESTS 25 61 3584000 2100
199897813 Arktomson D March 31, 2023, 1:46 a.m. OK GNU C++17 TESTS 25 62 1638400 2100
199836039 pengpeng_fudan D March 30, 2023, 2:14 p.m. OK GNU C++17 TESTS 25 62 1638400 2100
199954619 devanshmishra111 D March 31, 2023, 2:07 p.m. OK GNU C++17 TESTS 25 62 2457600 2100
199925554 WqSlfy D March 31, 2023, 9:14 a.m. OK GNU C++17 TESTS 25 62 3174400 2100
199923451 CCSU_LRF D March 31, 2023, 8:49 a.m. OK GNU C++17 TESTS 25 62 4812800 2100
199773017 zja601 D March 30, 2023, 2:04 a.m. OK GNU C++17 TESTS 24 62 4812800 2100
199846952 Jieneng D March 30, 2023, 3:18 p.m. OK GNU C++17 (64) TESTS 25 46 7987200 2100
200056752 oukeree D March 31, 2023, 11:27 p.m. OK GNU C++17 (64) TESTS 25 62 8908800 2100
199776090 yyyyyyyyyyyy D March 30, 2023, 3:12 a.m. OK GNU C++17 (64) TESTS 24 62 12800000 2100
199900598 hzy1 D March 31, 2023, 2:55 a.m. OK GNU C++17 (64) TESTS 25 62 13619200 2100
199802017 Legend_dy D March 30, 2023, 9:14 a.m. OK GNU C++17 (64) TESTS 25 62 13619200 2100
199767718 xiaoyiru D March 30, 2023, 12:01 a.m. OK GNU C++17 (64) TESTS 24 77 12800000 2100
199787934 Einstein1234 D March 30, 2023, 6:29 a.m. OK GNU C++17 (64) TESTS 25 77 13107200 2100
199923546 Liam_Evander D March 31, 2023, 8:50 a.m. OK GNU C++17 (64) TESTS 25 77 13619200 2100
199770428 chinvuho D March 30, 2023, 1:05 a.m. OK GNU C++17 (64) TESTS 24 77 13926400 2100
199889579 GoogleBot D March 30, 2023, 10:31 p.m. OK GNU C++17 (64) TESTS 25 77 15257600 2100
199898919 sweet_hope25 D March 31, 2023, 2:13 a.m. OK GNU C++20 (64) TESTS 25 31 2457600 2100
199793165 jtrh D March 30, 2023, 7:30 a.m. OK GNU C++20 (64) TESTS 25 31 2457600 2100
199777038 Joler_ D March 30, 2023, 3:31 a.m. OK GNU C++20 (64) TESTS 24 31 5632000 2100
199774601 wjli D March 30, 2023, 2:38 a.m. OK GNU C++20 (64) TESTS 24 31 13721600 2100
199918631 5hu8h D March 31, 2023, 7:49 a.m. OK GNU C++20 (64) TESTS 25 46 2457600 2100
199887253 paketik_chaya D March 30, 2023, 9:51 p.m. OK GNU C++20 (64) TESTS 25 46 2457600 2100
199793453 jtrh D March 30, 2023, 7:34 a.m. OK GNU C++20 (64) TESTS 25 46 2457600 2100
199740295 egorsa D March 29, 2023, 5:53 p.m. OK GNU C++20 (64) TESTS 24 46 3276800 2100
199853058 mailo102 D March 30, 2023, 3:58 p.m. OK GNU C++20 (64) TESTS 25 46 3584000 2100
199804045 Facelessman2.0 D March 30, 2023, 9:36 a.m. OK GNU C++20 (64) TESTS 25 46 4812800 2100
199839436 vankamamidi_dheeraj D March 30, 2023, 2:33 p.m. OK Java 17 TESTS 25 249 2457600 2100
199776679 Socrates1232 D March 30, 2023, 3:23 a.m. OK Java 17 TESTS 24 498 43929600 2100
199846826 QUITTING D March 30, 2023, 3:18 p.m. OK Java 8 TESTS 25 187 0 2100
199847164 QUITTING D March 30, 2023, 3:19 p.m. OK Java 8 TESTS 25 202 0 2100
199744867 Ziran3234 D March 29, 2023, 6:42 p.m. OK Java 8 TESTS 24 405 35123200 2100
199891145 lpychemistry D March 30, 2023, 11:05 p.m. OK Java 8 TESTS 25 420 35020800 2100
199748098 invincible777 D March 29, 2023, 7:20 p.m. OK Java 8 TESTS 24 421 41369600 2100
199771667 jhy0117 D March 30, 2023, 1:33 a.m. OK Java 8 TESTS 24 592 47513600 2100
199950012 elizarov D March 31, 2023, 1:20 p.m. OK Kotlin 1.7 TESTS 25 920 138956800 2100
199838883 Halcyflict D March 30, 2023, 2:30 p.m. OK MS C++ 2017 TESTS 25 218 40448000 2100
199745541 Lyle0711 D March 29, 2023, 6:50 p.m. OK PyPy 3 TESTS 24 249 16179200 2100
199917473 bvf D March 31, 2023, 7:33 a.m. OK PyPy 3 TESTS 25 374 27238400 2100
199769077 Lhohelhohehmm D March 30, 2023, 12:32 a.m. OK PyPy 3-64 TESTS 24 311 34713600 2100
199929695 tu144x D March 31, 2023, 9:59 a.m. OK PyPy 3-64 TESTS 25 327 38707200 2100
199872606 Alex239 D March 30, 2023, 6:51 p.m. OK PyPy 3-64 TESTS 25 358 40038400 2100
199821777 Yansou D March 30, 2023, 12:25 p.m. OK PyPy 3-64 TESTS 25 373 43724800 2100
199937634 iN_siDious D March 31, 2023, 11:23 a.m. OK PyPy 3-64 TESTS 25 373 44441600 2100
199761542 bronze_coder D March 29, 2023, 10 p.m. OK PyPy 3-64 TESTS 24 389 59494400 2100
199755814 liut D March 29, 2023, 8:47 p.m. OK Rust 2021 TESTS 24 109 30412800 2100

remove filters

Back to search problems