### arsijo's blog

By arsijo, 6 months ago, ,

Author: arsijo

Developer: StasyaCat

Author: arsijo

Developer: StasyaCat

Author: StasyaCat

Developer: StasyaCat

Author: lewin

Developer: lewin

Author: Noam527

Developer: Noam527

Author: Noam527

Developer: Noam527

Author: lewin

Developer: lewin

Author: aitch

Developers: aitch and majk

•
• +82
•

 » 6 months ago, # |   +9 Div2 C. Why my solution failed on test no. 17 I used Difference array and Binary search.? http://codeforces.com/contest/1075/submission/45302142
•  » » 6 months ago, # ^ | ← Rev. 2 →   +1 Not sure if this is your case, but I also used the same technique and got WA on test no.17 Maybe this test case might help you? 2 3 3 5 1 4 1 2 100000 2 1 4 3 My code outputs 2 but now I see that it should be 1...T_T
 » 6 months ago, # | ← Rev. 2 →   +56 Overall complexity of Div.2C should be O(nlog(n)) because of sorting.
•  » » 6 months ago, # ^ |   +20 NSA wants to know your location
•  » » 6 months ago, # ^ |   +6 That's true. Thank you.
•  » » » 6 months ago, # ^ |   +21 Thank you for this excellent contest.
•  » » » » 6 months ago, # ^ |   0 NSA here, open up
•  » » » » » 6 months ago, # ^ |   0 Dad?
•  » » » » » » 6 months ago, # ^ |   +5 MahmoudAlio, I am your father. Open up right now. Our family has been working for the NSA for generations under farmersrice and the codeforces triumvirate. Welcome to the underground world of cf.
 » 6 months ago, # |   0 Anyone know the tag for problem C Div 2? Solution presented above is greedy?
•  » » 6 months ago, # ^ |   0 Binary Search/Two Pointers. But I think it is more helpful to view it as adhoc where you have to make observations. In this case main observation based on vertical lines span the whole grid, and no horiztonal touching.
 » 6 months ago, # | ← Rev. 2 →   +6 Div2C: I did everything right, but forgot to write sort()... I am feeling so bad about this alexa play despacito
•  » » 6 months ago, # ^ |   0 Div1C: i did everything right but didnt pay attention that border size can be in exponent 18, which is not supported by default by javascript which i use... And it is the second contest at row... can you imaging how bad is my feeling =)
 » 6 months ago, # | ← Rev. 2 →   0 Nice !
 » 6 months ago, # |   +13 Div1D is not original.Here is the same problem in one of the Indian Regionals — https://www.codechef.com/KGP17ROL/problems/XORQUERY
•  » » 6 months ago, # ^ |   -26 E and F aren't great either. My understanding is that CF wants to encourage problem writers and the bar for problem quality isn't set too high, so unless contest organizers want high quality original problems (which wasn't the case this time but in the past for this reason some companies had problems set by their own engineers and not outsourced) you should not have high expectations.
•  » » 6 months ago, # ^ |   +51 Hey,I did not intend to copy/steal a problem by any means. Neither me nor the testers knew of this problem (and also no other task that is similar to div1D), otherwise it would be brought up. I'm sure you understand that we want to have tasks with as high quality as we can, and also being original. Still, I'll try to look deeper for tasks similar to mine, but honestly, I think it's impossible to assure my problems are original.Anyway, I hope you still managed to enjoy some other tasks from the round :).
 » 6 months ago, # |   0 Hi, Can someone tell me whats wrong with Code?? Interactive ProblemThanks in Advance
•  » » 6 months ago, # ^ |   0 The problemis that you need to run a bfs to find the closest vertex instead of finding any vertex like you do with your dfs.
 » 6 months ago, # | ← Rev. 2 →   0 Isn't W(3,5)⊕W(5,2) equal W(2,2), not W(3,2)?Because [3⊕4⊕5]⊕[2⊕3⊕4⊕5] is equal to 2.And that would mean that W(a,b)⊕W(b,c)=W(a,c)⊕b.
•  » » 6 months ago, # ^ |   0 In the presented solution, we look at the subarray by its end borders. So,
 » 6 months ago, # |   0 Can anyone help me out with Div. 2 F? I'm getting WA on test 14. I'm using dsu and merge small-to-large, and but I cannot tell what my error is and this problem is quite hard to debug.45341296
•  » » 6 months ago, # ^ |   0 update: I fixed my error, a pretty big one, actually. I was updating the subtrees with p[l]^p[r] instead of x^p[l]^p[r].
 » 5 months ago, # |   +15 Thanks a lot for detailed explanations!
 » 5 months ago, # |   0 Can anyone explain the dp part of Div1-C, Also what are c1,c2..,c6 wrt this question?
•  » » 5 months ago, # ^ |   +3 We need to find 3 points, such that |x1 — x2| + |y1 — y2| + |x2 — x3| + |y2 — y3| + |x3 — x1| + |y3 — y1| is maximal. We are going to try all possibilities of assigning + or — to each of these pairs. For example if we have +--+-+, we are going to have (x1 — x2) — (y1 — y2) — (x2 — x3) + (y2 — y3) — (x3 — x1) + (y3 — y1), which evaluates to 2*x1 — 2*y1 — 2*x2 + 2*y2 + 0*x3 + 0*y3. c1 here is the coefficient next to x1, c2 is the coefficient next to y1...c6 is the coefficient next to y3. So we calculate arrays P, Q, R as in the editorial and then do dp to get the maximum for such combination. The dp state is [current point][taken points]. You can also check out my implementation 45365331.
•  » » » 5 months ago, # ^ |   +3 Thanks a lot :) , I got majorly confused on how taking all possible combinations wont give wrong answer because we are taking the cases are not possible too, For those who are confused on this part -> max value of the expression can be |x1 — x2| + |y1 — y2| + |x2 — x3| + |y2 — y3| + |x3 — x1| + |y3 — y1|, any other case will be less than or equal to this, Hence this wont affect our maximum. With similar reason we can prove why this wont work for minimum.
 » 5 months ago, # | ← Rev. 2 →   +10 Thanks, StasyaCat for writing a descriptive and well explained tutorial for problem 1074A.
•  » » 5 months ago, # ^ |   0 Thank you :)
 » 5 weeks ago, # |   0 DIV2-B any better approach??