### papa-ka-para's blog

By papa-ka-para, history, 6 months ago,

Hi all,

I am trying to upsolve this problem. https://mirror.codeforces.com/contest/1699/problem/E

How to build the DP solution that is mentioned in the paragraph-2 ?

How to do it in O ( vmax * log vmax * log vmax ) ?

• 0

By papa-ka-para, history, 13 months ago,

I am trying to solve Problem D from CF-823(div-2).

https://mirror.codeforces.com/contest/1730/problem/D

1) DOUBT 1

The editorial says,

If you reflect the second string and see what happens, it is easy to see that the elements at the same positions in both strings after any action remain at the same positions relative to each other.

What does "reflect" mean here ? does the editorial mean that reverse the second string ?

2) Doubt 2 ,

If the word reflect means reverse, then, according to the editorial,

the elements at the same positions in both strings after any action remain at the same positions relative to each other.

What does this even mean ?

Considering the below example, Suppose we have n = 8, and instead of calling S1 and S2, I am calling then string S and string T,

s1  s2  s3  s4  s5  s6  s7  s8
|  |   |   |   |   |   |   |
t1  t2  t3  t4  t5  t6  t7  t8

There is mapping between each one of the position and relative order initially matching with each other.

Action 1 , K = 3
t6  t7  t7  s4  s5  s6  s7  s8
|  |   |   |   |   |   |   |
t1  t2  t3  t4  t5  s1  s2  s3

Action 2, K = 6

t3  t4  t5  s1  s2  s3  s7  s8
|  |   |   |   |   |   |   |
t1  t2  t6  t7  t7  s4  s5  s6


Now as we can see, that t3 character and s3 character are part of the same string, now what relative order are we talking about here ?

What exactly is happening here ?

It definitely is not EASY to see , """ that the elements at the same positions in both strings after any action remain at the same positions relative to each other""" .

• +1

By papa-ka-para, history, 14 months ago,

I am on codeforces from last 6 ++ years. Today I saw very rude and inappropriate posting behaviour from one fake profile.

PLEASE ADD FEATURE TO FLAG/REPORT a profile. If more than 100 trusted users are reporting the profile ( or if certain number of Div-1 coders are reporting the profile, it should be blocked ).

This guy is spamming on codeforces for no reasons. Some idiot with sick mentality thinks its funny to do so.

• +30

By papa-ka-para, history, 15 months ago,

we are given 4 integers, where a <= b , c <= d.

We have to find Sum of Xor of all the pairs (i,j) such that ( a <= i <= b , && c <= j <= d )

int sum = 0;

for(int i=a ; i <= b; i++) {
for(int j = c; j <= d ; j++) {
sum += (i ^ j)
}
}
return sum;



How to find this sum optimally ?

• -18

By papa-ka-para, history, 16 months ago,

Hello @MikeMirzayanov ,

I feel like this is Bug and Not Intended Feature.

I had registered in div.4 contest when my ratings were above 1399 . After yesterday's contest my ratings fell below 1399. On participants page, I saw that contest is marked unrated for me ( which is wrong, It should be rated for me at my current ratings).

here, participants ratings while registration is taken in count and not current ratings.

I tried to find some portal where I can report bugs, But I couldn't find it. So I decided to post it here.

• +29

By papa-ka-para, history, 17 months ago,

The editorial for D1 ( Easy version ) , I am facing difficulties understanding the editorial solution ...

Note that because we guarantee that the root is a query, when we are computing the answer for any node 'v' in this DFS, we can assume that either 'v' or some vertex not in the subtree of 'v' has already been queried.

can someone elaborate little ?

• 0

By papa-ka-para, history, 18 months ago,

Hi everyone,

I am trying to solve the problem here :

https://mirror.codeforces.com/contest/1758/problem/E

This is an editorial for the problem : https://mirror.codeforces.com/blog/entry/109438

I am having few doubts after reading the editorial. Can someone help out ?

My doubts : 1)

Using these relationships, we can create a weighted directed graph using our rows as nodes.

What is direction of the edge in graph ? What should be the weight of the edge ?

2) Obviously, no solutions exist if there are discrepancies in the graph (modℎ), no solution exists.

What is meaning of discrepancies in the graph ?

3) Now, for each connected component, if there is an assigned value in one of the rows it contains, we can determine all of the other values for that column in the connected component.

How can we have connected components in the directed graph ? Are there all nodes reachable from all the other nodes in the component ?

Can someone help me clear doubts so I can upsolve ?

• +3

By papa-ka-para, history, 7 years ago,

Hello everyone,

I was trying to solve 451 D question. and which turn out to be an easy question due to given constrain of distinct times for each alarm clocks (Please refer to question if you don't understand).

Now I had doubt. What if there could be repetitive values for alarm clocks timings. is it possible to solve this problem with greedy approach ?

If Yes/no , can you please provide proof method.

Thank you (GL & HF)

• 0

By papa-ka-para, history, 7 years ago,

Hello guys,

I have created video on 2-Dimensional segment tree. Pre-requisite for this video is one-dimensional segment tree. I have tried to explain things as easy as possible.

2D segment tree video tutorial

we have attached code in description.(it's not full version in initial steps, because, we want you to try, functions that we have mentioned in code. I am sure, if you watch video 2-3 times, you will surely be able to implement 2D segment tree by yourself. )

Good Luck and Have Fun. Happy Coding.

Thanks again, gkcs

• +51

By papa-ka-para, history, 7 years ago,

Hello guys, This is my first Video Tutorial. I have made tutorial on 'C-question', Div-2 , Round 439.

This question uses simple Combinatorics(Maths). Hope you find is useful. If anyone who has doubts, feel free to ask in comments. Looking forward to make more video tutorials in future! Cya!

Thanks to gkcs for his help and support.

• +13

By papa-ka-para, history, 7 years ago,

while learning from tutorial, I was able to understand first paragraph clearly. I can also see that we just need to find out elementary cycles in graph(which can be done with how to find primary cycles in undirected graph ? , an answer written by Aditya Prakash) .

Now I am not able to grasp how does gaussian method works. I have also tried to look into some solutions like, born2rule , rajat1603 , shubhamgoyal__ . all this solutions look very similar, which uses gaussian method.

so , can someone help me out with gaussian method ? what it actually does ? and when can we use it ?

• +6

By papa-ka-para, history, 7 years ago,

I have been trying to solve this question with MO's algorithm. but My solution was getting TLE. Please somebody share an approach, if it is possible to solve with MO's algorithm . Link to problem : http://mirror.codeforces.com/contest/588/problem/E

• 0