Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AtCoder Beginner Contest 188 Editorial #26

Open
utterances-bot opened this issue Jan 10, 2021 · 6 comments
Open

AtCoder Beginner Contest 188 Editorial #26

utterances-bot opened this issue Jan 10, 2021 · 6 comments

Comments

@utterances-bot
Copy link

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/

Copy link

once again thankyou!

Copy link

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

@lucifer1004
Copy link
Owner

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.

Copy link

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

Copy link

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

@kabbo25
Copy link

kabbo25 commented Jan 11, 2021

Such a great tutorial sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants