Hello, everyone.
I am organizing my first contest and I would really appreciate your feedback. All the details about the contest are on the sign-up page. A rough estimate of the difficulties of the tasks would be [800-2000]. Solutions are accepted only in C++. Feel free to ask any questions in the comment section or via a private talk.
UPD1: I added java, C and python.
UPD2: Thank you for attending and congratulations to everybody! I am eager to hear your impressions.
Editorial is out.
If its through hackkerank, why only cpp?
Agreed, all the infrastructure is there for you to allow Java + other languages, so why the arbitrary restriction?
I am not experienced enough to set proper time/memory limits for other languages. Better safe than sorry.
UPD1: I added java, C and python.
UPD2: I tried my best to set adequate time/memory limits
Hey, I have a doubt in the first question. We have been given an array of speed and we choose two horses for a race in such a way that the absolute difference between their speed is as small as possible. Then we need two return an array of index of horses which wins the race. Is my understanding correct??
If it is correct, then consider this test case: N = 6 speed = [90, 92, 93, 95, 96, 98] Currently, least difference is 1 so we select the pairs (92,93),(95,96) for the first two selection. For the third race, we select the pair(90,98). Hence, my answer is (3,5,6). The editorial code answer is (2,4,6).
Can you tell me where I am going wrong??
Now i realize that i wasn't clear enough with the statement. In your example you should first take care of the horse with the speed 90 and pair it with the horse 92.
No problem ;) The problems are good!!
what are the prizes?
My honest gratitude
Good questions. In 3rd question, why my Binary indexed tree approach gives TLE? Question MySolution
You don't take into account the case when one given number is equal to 0. You can just skip those zeroes:)
Thank you, figured it just now.
Is it possible to solve problem C by PBDS?
SecondThread Any thoughts on this?
I didn’t need anything that complicated for it. Just a map was sufficient for me.
Interesting problems bro. Hope you organise these contests regularly :)
Thank you a lot.
Good idea for E, I really forgot that the bits were just being flipped. I think the time complexity can be improved though. Instead of a Fenwick tree, just a simple
set<pair<int, int>>
can be used to store the endpoints of continuous segments of ones. To find which segment containing some index, just find the segment with the closest left endpoint to that index, and check if the right endpoint is on the right of that endpoint.Nice idea. Yeah, my solution can definitely be improved.
Nice problems,very well balanced in my opinion. Just one question, what would be the approximate ratings of each of the problems according to codeforces standard? TIA.
Quite hard to tell. The only thing that I can say is that according to plenty of participants problem B was harder than problem C.
I am very sorry but i am stuggling with B question in this contest for hours, i am unable to find the mistake in my code (i am ashamed of this), please help me . Code is here ----->
Change
int ans
tolong long ans
, andlong long sum
too. Andphi
to vector oflong long
as well.i am sorry but you haven't seen
#define int long long
on topI just changed the evaluation of phi(all but 1 cases got accepted) and then updated MAX. It got accepted. ModifiedCode. BTW how to format code as it is in comments?
Glad you got it accepted. There is an option called
spoiler
While calculating the
phi
array, why you only iterated till $$$\sqrt{MAX}$$$ tho? What about the prime bigger than $$$\sqrt{MAX}$$$? Theirphi
value will be itself minus 1 and seem like you did not update that.Yes not i got it , thank you so much
I am getting wrong answer in 4 test cases for problem B( GCD Table ), can someone help me ? . Link to my code
Your code fails if the input contains zeroes. You shouldn't subtract 1 in case of 0. Accepted Code