### Forcharc's blog

By Forcharc, history, 5 years ago, translation,

• +15

 » 5 years ago, # | ← Rev. 2 →   0 the content isn't working now: while opening file this message is found "the archive is either in unknown format or damaged"
•  » » 5 years ago, # ^ |   0 Very strange. Anybody has a similar problem?
•  » » » 5 years ago, # ^ |   0 Yes, me too.
•  » » 5 years ago, # ^ |   +1 I had that problem too. But when I opened that file with 7zip, it has been opened normally.
 » 5 years ago, # |   0 reoutloaded
 » 5 years ago, # |   0 Does anyone know how to solve 3rd problem (C problem) in better complexity than O(N*sqrt(N))?
•  » » 5 years ago, # ^ |   +3 Consider a set of points (l, r) on plane such that 0 ≤ l ≤ r ≤ n - 1 where the point (l, r) corresponds to a segment [l, r].Consider some number x and all its occurrences. Suppose that the number x is one of the numbers that make some particular segment [l, r] be bad. Then one of the following situations should happen: either there are from 1 to x - 1 or more than x + 1 occurrences of x in [l, r]. That means that for the fixed l there are two segments of banned values for r. Actually, for any possible l lying between two consectuvie x's, those two banned segments for r will be the same. It can be reformulated that there are O(cx) banned rectangles on a plane that point (l, r) isn't allowed to be in, where cx is the number of occurrences of x.Construct all such rectangles for all numbers x, there will be O(n) of them in total, and then calculate the number of points that do not lie in any banned rectangle in via sweeping line.Although this solution has better time complexity, there are solutions that work even faster because they do not utilize much memory and use only simple operations.Code for reference: solution by me: http://pastebin.com/k0GHWxuQ solution by Errichto: http://pastebin.com/UXziv4iD
•  » » » 5 years ago, # ^ | ← Rev. 3 →   0 Sorry, just mixed up.
•  » » » 5 years ago, # ^ |   0 Why it's ?
•  » » » 3 years ago, # ^ |   0 Isn't there supposed to be an extra line between 26 and 27 which is like line 31?
•  » » » » 3 years ago, # ^ |   0 Ask not me, but Errichto.
•  » » » » » 3 years ago, # ^ |   0 But you are good enough to check other's code right?
•  » » » » » » 3 years ago, # ^ |   +10 nah, I'm more about writing comments :)
•  » » » » » » » 3 years ago, # ^ |   +18 :)) thanks for not helping :))
•  » » » » 3 years ago, # ^ |   0 .
 » 5 years ago, # |   0 Can someone explain the solution of problem A Day1?
•  » » 5 years ago, # ^ |   0 The download link doesn't work for me, can you share the problem statements somewhere else?
•  » » » 5 years ago, # ^ |   0 It's in Russian anyway
•  » » » » 5 years ago, # ^ |   0 Oh ok. I thought it was in english since the discussion was in english.
•  » » » 5 years ago, # ^ |   +8 Problem AGL & HF :)