On prophet_ov_darkness → [GYM] 2018 BACS Contest Replay, 3 years ago +1 We're working on it. It'll be posted soon.
 On awoo → Educational Codeforces Round 44 [Rated for Div. 2], 3 years ago 0 wow ._.
 On awoo → Educational Codeforces Round 44 [Rated for Div. 2], 3 years ago +14 I have time, but unfortunately, I lack patience.
 On awoo → Educational Codeforces Round 44 [Rated for Div. 2], 3 years ago 0 Can you give me some hint / any tutorial about that algorithm?
 On rng_58 → GP of Poland, 3 years ago +10 How to solve E?
 On sd0061 → XVIII Open Cup Grand Prix of Eurasia, 4 years ago +1 Let us first calculate the expected gain of NSU for a given fixed entrance day t (1 ≤ t ≤ T).Suppose, S =  The set consisting of the students who applied to NSU. Where, P(i, t) = Probability that the i-th student will be available till the t-th day.Gi = Value of the i-th student.If you can calculate E(t) in O(K), then the total complexity of your solution will be O(TK) (as you can iterate over all possible valid t ). You can speed up the solution with this optimization. How to calculate P(i, t):Suppose, C =  The set consisting of the colleges where the i-th graduate has applied. rij =  The day on which the i-th graduate applied to the j-th college. G(c, l, r) =  Probability that the c-th college will have its entrance day between the l-th day and r-th day. Then: On sd0061 → XVIII Open Cup Grand Prix of Eurasia, 4 years ago 0 For problem 4(Universities), Is O(T * K) fast enough to pass? I got TLE on test 9.
 On rng_58 → AtCoder Grand Contest 016, 4 years ago +25 I can solve this problem if both the arrays are some permutation of the first n numbers. But what if one number appearance more than once? How to create a graph in such case?
 On bertho_coder → WF Visa Application, 4 years ago +68 We applied 2nd time for the visa today and we got accepted. May be you can think about applying for the second time if it is possible.
 +1 I've gone through the "Advanced Topics" part and my reaction while reading this book can be described as: wow wow wow wow wow wow..... Thank you for sharing it.
 On sd0061 → XVII Open Cup Grand Prix of Wroclaw, 5 years ago +15 Why does it work?
 +3 "For the arrangement to be liked by Jon each of the f + 1 partitions created by f food boxes must contain either 0 or greater than h wine barrels"- I don't get the "must contain either 0 or..." part. Is it possible for a stack to be empty?
 On fcspartakm → Codeforces Round #375 (Div. 2), 5 years ago +5 Yes I also think that it's similar to rectilinear Steiner tree problem. So yes, may be it's NP-hard.
 On fcspartakm → Codeforces Round #375 (Div. 2), 5 years ago +3 I first misunderstood problem D and thought that I'm allowed to change " * " sign to ".". I found this problem interesting but couldn't come up with any solution.
 On Eran → Codeforces Round #365 (Div. 2) Editorial, 5 years ago +30 But this guy managed to pass :)
 On himanshujaju → Parallel Binary Search [tutorial], 5 years ago 0 Oh thanks! Didn't see that the editorial was there.
 On himanshujaju → Parallel Binary Search [tutorial], 5 years ago 0 That's a cool trick :) I tried to solve the problem "Make n00b land great again" but couldn't figure out how to efficiently update the queries. Can you please explain how to do it efficiently?
 On BayHarborButcher → Who else had his rating decreased?, 5 years ago +5 Me too. I don't know why :/
 On adamantium → How to solve spoj KALTSUM - k Alternating Sum, 5 years ago +19 Break the problem into two cases: when k > sqrt(n) and when k <= sqrt(n). Deal with them in different ways.Case 1: For any k > sqrt(N) there will be less than sqrt(N) alternating segment. If you have an array, having cumulative sum, you can get the sum of a contiguous segment in O(1). So you can just loop over the alternating parts and get the sum in O(sqrt(N)) for a single query. Case 2: Now when k <= sqrt(n), you need to do some preprocessing. let arr[k][i] be the "k alternating sum" of a subarray which starts at position i and keeps alternating untill it reaches a position x such that if you add another segment of size k then it will go out of the array. [ This array can be computed in O(N) , and as you're doing it for every k < sqrt(n), the total complexity is O(N * sqrt(N))] With the help of this array, you can answer every query having k < sqrt(N) in O(1). Hope that helps.
 On csacademy → New Online Judge Platform — csacademy.com, 6 years ago +5 wow :D Awesome experience :D I enjoyed the contest very much :)
 On Deemo → Ternary Search on Integers!, 6 years ago +8 Does it work correctly in case f(mid) == f(mid + 1) ? For example: f = {0, 1, 0, 0, 0}
 0 For every edge (x<->y), we need to calculate how many edges (p<->q) intersect it. In order to make sure that we are not overcounting, we'll only consider such edges (p<->q) where x < p < y < q [They surely intersect each other]We can do that in O(log n). Maintain a segment tree where a node in the segment tree having range [i..j], holds the end points of the such edges (u <-> v) such that i <= min(u,v) <= j, in sorted order.Now suppose we want to know how many edges (p <-> q) intersects with (x<->y) where x < p < y < q. To get this, we'll query on the range [x+1..y-1]. As we have the end points in sorted order in the segment tree, we'll binary search on y to get the answer.
 On Endagorion → Codeforces Round #295, 7 years ago +49 1699 to 1699 ._. 