cp-wiki icon indicating copy to clipboard operation
cp-wiki copied to clipboard

AtCoder Beginner Contest 188 Editorial

Open utterances-bot opened this issue 4 years ago • 6 comments

AtCoder Beginner Contest 188 Editorial | CP Wiki

Find the maximum of the lower half and the upper half, and compare them. The index of the smaller value is the answer we need.

https://cp-wiki.vercel.app/en/tutorial/atcoder/ABC188/

utterances-bot avatar Jan 10 '21 16:01 utterances-bot

once again thankyou!

Adityakrmishra1 avatar Jan 10 '21 16:01 Adityakrmishra1

Hi I cannot understand why do we need a-1 and b+1 too in problem D .

too-rusty avatar Jan 10 '21 19:01 too-rusty

Hi I cannot understand why do we need a-1 and b+1 too in problem D.

Actually what we do need is a and b+1. a-1 and b are unnecessary. I will update my editorial and code.

Suppose we have [1,6] and [4,9]. The intersection of these two intervals will make three non-overlapping segments: [1,3], [4,6] and [7,9] (and there is supposed to be a virtual segment [10,inf]). To make these final segments, we would need the start of each segment, and in this case, the starts are 1, 4, 7, 10, which all come from a and b+1.

lucifer1004 avatar Jan 11 '21 01:01 lucifer1004

hello, i really cant understand how you are doing the last problem with bfs. can you please give a detailed explanation. thankyou!

srthkhny1 avatar Jan 11 '21 07:01 srthkhny1

really nice explanation for D, actually i was thinking the same way but was using other hacky implementations, b+1 technique is really nice

too-rusty avatar Jan 11 '21 14:01 too-rusty

Such a great tutorial sir

kabbo25 avatar Jan 11 '21 15:01 kabbo25