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

Автор Boring_Day, история, 19 месяцев назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 20 месяцев назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 20 месяцев назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, 21 месяц назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 22 месяца назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 22 месяца назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • -38
  • Проголосовать: не нравится

Автор Boring_Day, 22 месяца назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 22 месяца назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 23 месяца назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, 2 года назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 2 года назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 2 года назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 2 года назад, По-английски

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
  • Проголосовать: не нравится

Автор Boring_Day, история, 2 года назад, По-английски

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?

Please Help.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится