codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

1996.md (1987B)


      1 Source: https://codeforces.com/blog/entry/131948
      2 
      3 [1996A - Ноги](/contest/1996/problem/A "Codeforces Round 962 (Div. 3)")
      4 
      5 **Hint**
      6 
      7 Greedily take Cow as long as you can.
      8 
      9 **Video editorial**
     10 
     11 [1996B - Масштабирование](/contest/1996/problem/B "Codeforces Round 962 (Div. 3)")
     12 
     13 **Idea**
     14 
     15 Just print all index $A[i*K][j*K]$
     16 
     17 **Video editorial**
     18 
     19 [1996C - Сортировка](/contest/1996/problem/C "Codeforces Round 962 (Div. 3)")
     20 
     21 **Hint**
     22 
     23 [Prefix Sum](https://usaco.guide/silver/prefix-sums)
     24 
     25 **Video editorial**
     26 
     27 [1996D - Веселье](/contest/1996/problem/D "Codeforces Round 962 (Div. 3)")
     28 
     29 **Hint 1**
     30 
     31 Bruteforce works, now analyse why it works.
     32 
     33 **Hint 2**
     34 
     35 [Sum of Harmonic series](https://mathworld.wolfram.com/HarmonicSeries.html)
     36 
     37 **Video editorial**
     38 
     39 [1996E - Декодирование](/contest/1996/problem/E "Codeforces Round 962 (Div. 3)")
     40 
     41 **Easy version**
     42 
     43 [Count no of substrings with equal 0s and 1s](https://leetcode.com/problems/count-binary-substrings/description/)
     44 
     45 **Hint 1**
     46 
     47 Replace all 0 with -1. Now all segments with equal 0 and 1 have zero sum.
     48 
     49 **Hint 2**
     50 
     51 Instead of counting segments inside each range. For each substring with zero sum, count segments it is a part of.
     52 
     53 **Video editorial**
     54 
     55 [1996F - Бомба](/contest/1996/problem/F "Codeforces Round 962 (Div. 3)")
     56 
     57 **Hint 1**
     58 
     59 Greedy, always take the index with maximum value of $A-i$
     60 
     61 **Hint 2**
     62 
     63 [Binary search FTW](https://codeforces.com/blog/entry/92248)
     64 
     65 **Hint 3**
     66 
     67 Binary search on the value you will add in $k^{th}$ operation.
     68 
     69 **Video editorial**
     70 
     71 [1996G - Пенакония](/contest/1996/problem/G "Codeforces Round 962 (Div. 3)")
     72 
     73 **Hint 1**
     74 
     75 Delete one road, now path between any pair of friends is unique. Try to count paths which do not lie between any pair of friends.
     76 
     77 **Hint 2**
     78 
     79 Given an array A, and multiple queries $L_i$ and $R_i$. Can you find the minimum value in this range, and how many times it appears?
     80 
     81 **Video editorial**
     82 
     83 **Daily Chat QnA**