### WorstCoder45's blog

By WorstCoder45, history, 20 months ago,

Link to the problem : https://www.codechef.com/AGPR2020/problems/ALPR2005

Statement :

Given a binary sequence of length $n$, find the minimum number of changes needed so that bitwise-xor of every subarray of size $k$ is exactly 1 .

1<=n,k<=100000 .

A change operation is defined as : "You can change "1" to "0" , vice-versa"

The only thing I could decipher till now is that the answer mainly depends on the first subarrays of size k .

• 0

By WorstCoder45, history, 22 months ago,

This problem is from some old contest of codeforces , I don't remember its name anymore . But the problem idea seems interesting.

Problem :

Given $n$ segments $[l,r]$ , segment $[l1,r1]$ belongs to the first person, $[l2,r2]$ belongs to the second person, and so on...

Each person should select any one day/number from his own segment.

We have to find any assignment for every person to a particular day, such that every person has selected a unique day .

Example :

Range of first person : $[1,5]$

Range of second person : $[7,8]$

Solution : First person selects day-1 and second person selects day 7.

Another example :

Range of first person : $[1,2]$

Range of second person : $[1,3]$

Solution : First person selects day-1 and second person selects day 2.