### Boring_Day's blog

By Boring_Day, history, 11 months ago,

Lets say you have a matrix. Write a function which takes cell points and a number k. (It returns sum from rows).

for ex: func(i, j, k) here i and j are cell position. And k is a number. // I want sum from continuous rows.

I want sum from mat[i][j-k] to mat[i][j+k] + sum from mat[i-1][j-(k-1)] to mat[i-1][j+(k-1)] + sum from mat[i-2][j-(k-2)] to mat[i-2][j+(k-2)] and so on. If you go out of border add zero (do nothing).

Help me please Tell me if i clearly explai the problem or not.

• +6

By Boring_Day, history, 11 months ago,

If it is possible to create a vector of class then it should not be an issue to create vector of segment tree in c++.

Can you help me in these two things.

1st) when the size of segment tree at each index is same.

2nd) when the sizes at different indices are different.

Even if you help me solve the 1st thing i will be thankful to you.

• -10

By Boring_Day, history, 11 months ago,

Can someone help me solve this task?

You are given mysql workbench and as you know that there is an option of auto increment in workbench for primary key which takes the maximum used number adds 1 to it for new row generations. But your task is to take the minimum value which is not present in the table as primary key for newly formed row.

So, how will you solve this task? Help

• -36

By Boring_Day, 13 months ago,

Yeah i am talking about the same thing happened in previous contest but don't you think that those guys who reached expert/CM tag don't deserve it. It is really unfair.

That round must be unrated. You can say ratings doesn't matter but then making the round unrated should not be an issue.

• -15

By Boring_Day, history, 13 months ago,

As we can see that some people have habit of directly using recursive dp even for the easiest of the problems. But it becomes very problematic. You can't solve problems in which you need to save memory by knowing the previous row, and also in some prolems like recent E "Sum over zero" where you will face some issue related to time and memory. And i don't think it's possible to solve it with recursive dp. So i would suggest you guys to solve problems with iterative dp. Make a habit of using iterative dp. It will be beneficial for you guys in future.

• -13

By Boring_Day, history, 13 months ago,

Why next cf contest is coinciding with leetcode contest. I am so confused. In which contest must i participate?

• -38

By Boring_Day, 13 months ago,

You are given a tree. Each node has a value. You need to choose three distinct paths in the tree. Let's suppose that

P1= sum of path 1, p2 = sum of path 2, P3 = sum of path 3

Print minimum and maximum possible value of

|P1-P2| + |P2-P3| + |P3-P1|

Constraints 3<= n <= 2e5

• +15

By Boring_Day, history, 14 months ago,

I have seen many of my smart friends not getting a job where many dumb girls are getting it easily. What's the matter. Can someone explain?

• -64

By Boring_Day, history, 14 months ago,

I can't see any div3-div4 in contest. I have been waiting since a long time now. Is there anyone who can guess a date on which we expect a div-3 or div 4

• -20

By Boring_Day, 15 months ago,

This person Sneh_Patel_0701 has cheated very badly that now he is going to become expert. you can see for G even the template is not same. Sir, MikeMirzayanov some people are trying hard to reach that blue colour and some are just getting it for no efforts. please ban these people so that the cheaters will think twice before cheating. A humble request!

This person sneh_patel_0701 cheats in almost all the rounds but still didn't get caught. and now he is going to become expert. That's the reason i have written the blog.

Thank you

• +30

By Boring_Day, history, 16 months ago,

They have removed my participation of round G from certificate. Can you guys confirm that it's not only me.

Can you see your round G participation in the certificate tell.

• +2

By Boring_Day, history, 17 months ago,

So today i was learning about c++ lambda functions. and i have some doubts.

Q.1) See this

why the output is 2?

Q.2) another question

This is giving me runtime error why?

tell me

• -23

By Boring_Day, history, 17 months ago,

hey i want to calculate something i needed some attention so i wrote must read blog.

let's say i want to calculate a*b % P where 0<= a,b <= 1e9 and p = 1e9+7

how to calculate this by using only integer number i don't want to use long long as many stupid people do.

• -50

By Boring_Day, history, 18 months ago,

I was solving yesterday's c with a different approach. To solve it with my technique what i need to know is:

Let's say we have a string 's' of length 'n' with parenthesis ('(' or ')') and we have queries with 'L' and 'R' (1<=L<=R<=N).

we need to tell whether the substring from L to R is balanced or not.

Is there any way to solve the queries in constant time or lets say log(n) time?