Блог пользователя Vladosiya

Автор Vladosiya, 3 года назад, По-русски

1811A - Вставь цифру

Идея: ibraevdmitriy, разработка: ibraevdmitriy

Разбор
Решение

1811B - Конвейерные ленты

Идея: Vladosiya, разработка: ibraevdmitriy

Разбор
Решение

1811C - Восстанови массив

Идея: MikeMirzayanov, разработка: myav

Разбор
Решение

1811D - Умка и долгий перелёт

Идея: Gornak40, разработка: Gornak40

Разбор
Решение

1811E - Живая последовательность

Идея: Aris, разработка: Aris

Разбор
Решение

1811F - Это цветок?

Идея: Vladosiya, разработка: Vladosiya

Разбор
Решение

1811G1 - Влад и правильные пути (простая версия)

Идея: Vladosiya, разработка: Vladosiya

Разбор
Решение

1811G2 - Влад и правильные пути (сложная версия)

Идея: Vladosiya, разработка: Vladosiya

Разбор
Решение
Разбор задач Codeforces Round 863 (Div. 3)
  • Проголосовать: нравится
  • +52
  • Проголосовать: не нравится

»
3 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Auto comment: topic has been translated by Vladosiya (original revision, translated revision, compare)

»
3 года назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

Great problems! had so much fun during the contest. One of the most interesting Div 3 contest for sure. Happy coding :)

»
3 года назад, скрыть # |
Rev. 3  
Проголосовать: нравится +4 Проголосовать: не нравится

The contest was good. I wish div 3 and div 4 will be arranged atleast 2 — 3 times a month for beginner like me

»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Still i can't visualize problem D.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Can somebody give a recursive and easily understandable solution for g1/g2?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Can someone explain editorial of G1?

  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится 0 Проголосовать: не нравится

    TBH it's a brute force with some memorization. if you find it hard you can train more on dp problems :)

    But I'm gonna try to explain anyway. (I Hope it helps beginners)

    for G1 :

    first, find the longest path :

    each segment must contain k elements of the same color. so to define a state for dp, you should indicate the current index, how many elements there are in the current segment, and what is the current segment's color.

    for each element, you try to put in the current segment if you can (if the elements in the current segment are less than k, and the color of the current index is the same as the current segment color).

    or you start a new segment from this index (if the size of the current segment is 0).

    or do nothing with the current index.

    Now you have the longest path value for each index, now make another dp to count the ways to construct a path with the optimal answer.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится
»
3 года назад, скрыть # |
Rev. 4  
Проголосовать: нравится +3 Проголосовать: не нравится

Can someone explain this line "and these cycles do not intersect at the vertices" in problem F, when the simple cycle intersect at the vertices?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Problems are seems harder than usual div3...though they are fantastic..

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For problem C, a[i]=min(b[i],b[i+1]) at 2≤i≤n−1 is right?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Interesting problem E

»
3 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

G2 can be solved by finding the number of paths of length m for each possible m ending at each i and updating the max m divisible by k and the respective number of ways to reach max respectively. Submission: 200833766

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

in D point number 4, don't you mean $$$F_{n-1} \le y_n \lt F_n$$$ ?

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

myav In the editorial for problem C, $$$a_i = min(b_i, b_{i-1})$$$ for $$$2 \le i \le n-1$$$. Please correct it.

»
3 года назад, скрыть # |
Rev. 3  
Проголосовать: нравится -9 Проголосовать: не нравится

Vladosiya why my solution-200898470 got TLE its same as mentioned in editorial .. the same it getting accepted in PyPy-3-200940055.During contest it got accepted in PyPy-2 but after testing i got tle and my rank reduced from 4k to 10k. It's not fair. Please look into it.

I was so close to get pupil but lost it.

BY the Way u must know PyPy-2 is faster than PyPy-3

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I can't understand the Tutorial of E ...

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

can Someone explain D, i really can't wrap my head around bunch of inequalities given in the tutorial!

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For A, why does the O(n) solution run out?200968450

It is guaranteed that the sum of n for all test cases does not exceed $$$2⋅10^5$$$ . My English is so poor that I can't understand the meaning of this sentence.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Another approach to solve E 1)Let our initial answer be k itself. 2)Now count the no of numbers which contain 4 until k. 3)Add this count to k(our new ans). 4)Now count the no of numbers which contain 4 until our new answer and subtract this count by previous count(as prev count was taken into consideration at step 3). 5)update our value of ans by adding the count. 6)Repeat until our ans is not updating to a new value.

Basically a Gauss-Seidal Approach.

200812209

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Can someone explain editorial of G2 in detail?

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone help me figure out why this submission has a run-time error? 201201145

I have been stuck on this problem for a long time and I'm not quite sure why it has a run time error. :/

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hey in problem C mike's solution doesn't stand out if the array b is 1 4 5 3 2 1 In other words if my array has a peak middle element is greater than it's adjacent elements 5 7 3 or 0 4 0 anything. Can anyone help me with it.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

how did you decide that only fib0^2 + fib1^2 + .... fib^n = fibn*fib(n+1) is the only way to split the product into n+1 numbers?

Do you have some proof regarding this?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For the solution to G1, how can we show that the number of paths is never a multiple of the mod? If the number of paths is a multiple of the mod, we would skip over the current length and go to the last longest length.

»
13 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

If someone is stuck on the E problem and is unable to understand the tutorial, here is my approach:

  1. Go read about Digit DP.
  2. Now you are good to go.
  3. Using Digit DP, maintain a count of numbers having '4' as a digit up to the ith number.
  4. Now, do a binary search on numbers:

if (mid — dp(mid) >= n) {
ans = mid;
hi = mid — 1;
} else {
lo = mid + 1;
}

This efficiently finds the smallest valid number satisfying the condition. for more clarity check out my solution :>) here's the link https://mirror.codeforces.com/contest/1811/submission/310469201

»
7 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Holy shit the tutorial for Problem E is so bad, a toddler could've explained what he understands better than this