Comments

Hi Arpa,

Nice to hear. I'm interested in improving this project.

https://github.com/sukeesh/gocf

Shall we discuss on GitHub issue of this repo?

WA 29905833

Instead of storing all the divisors of current nude in a vector because of memory constraints, I tried to iterate through all divisors of current node again and decremented the count.

Why does this fail?

Can someone explain reason for WA?
MATDYS

Can someone explain reason for MLE in my code?

Code : 28646208

You can solve this without binary search too.

You should remove k integers either from starting or ending because removing elements from the middle of the array only increases the consecutive difference and It doesn't make sense.

We start by building segment tree on the consecutive differences.

and then we iterate the array from left to right, at every index i we assume that we have removed i elements from starting and now, we need to remove k — i elements from the end.

We now query for the maximum difference in this remaining segment and the final answer would be the minimum of these queries.


Code
On cgy4everTopcoder SRM 704, 9 years ago
0

Just mail them.

+4

I'm in

Can someone explain why did my code fail?

23085756

Care to explain?

Same Argument!

Why does he even include bands with > m if he doesn't like them? :(

Much simpler solution for D 21091527

Push all elements into a Priority Queue and pop out the top element, reduce it ( divide by 2 ) until it encounters a value which isn't visited yet and push reduced value into this Priority Queue.

Repeat this process until you are unable to reduce the top most element further.

That's it!

Yes, I agree with you!

Yeah, this has become very frequent these days :(

O(N * sqrt(N)) doesn't work here.
Intended solution is O(N * log(N))
here N  =  106
so O(N * sqrt(N)) would be of order 109, which is hard to pass even though you make good I/O optimisation.
Use MO's Algorithm for N  =  105 order.

On GlebsHPCodeforces Round #363, 10 years ago
+5

Thanks for the test case!

19278465

On GlebsHPCodeforces Round #363, 10 years ago
+1

Div2 D,
19261965 Where did I go wrong?
This test case has 0 roots.
Can someone please help?

Auto comment: topic has been updated by Sukeesh (previous revision, new revision, compare).

I am majoring in Metallurgical and Materials Science Engineering. I have serious hatred towards my branch. I don't belong to any Programming/Mathematical Clubs in our Institute.

I like to solve Mathematical Problems and Participating in Programming Contests is fun!

Thanks!

Auto comment: topic has been updated by Sukeesh (previous revision, new revision, compare).

This solution might lead to unbalanced BST. This leads to O(N) height and O(N^2) insertions.

Done, Now works fine for all the contests!

Done!

Auto comment: topic has been updated by Sukeesh (previous revision, new revision, compare).

On MrNullCodeforces Round #343 (Div. 2), 10 years ago
0

your first submission gets skipped

yes, will do it! :)

Yes,
We need to change it here
Almost all the contests have A-E , except for some openCup rounds
I will add that feature as soon as possible.

first incf, enter the contest code ( Contest code is different from round number )
. for example, take 8VC Venture Cup Quals.,
Contest code is 626, let's say you want to test it for problem A, Your Problem name should be in the format 626_A.cpp [Strict]. Now, gocf 626_A.cpp

open terminal sudo vim /bin/gocf, change the line 5
replace ~/GoCF/sukeesh.txt with /home/<username>/GoCF/sukeesh.txt

and in line 21 to pathe='/home/<username>/GoCF/'
It should work fine now!

did you create a directory named 'GoCF' in your home folder?
and do touch ~/GoCF/sukeesh.txt .

On zelibobaAIM Tech Round 2, 10 years ago
0

See this one, link

Reach Div1 by the end of 2016 ! :) , Happy New Year Everyone !!

On EdvardEducational Codeforces Round 4, 10 years ago
0

How to solve problem E ?

On ed1d1a8dCodeforces Round #336, 10 years ago
0

my AC was : http://ideone.com/z8dqVj ( No Binary Search )
consider this dp state ,
dp[present_pos] = total_beacons_affected_by_present_beacon + dp[previous_unaffected_beacon]
here, previous unaffected beacon means the beacon which is unaffected by the present beacon
After that try to disable beacons from present pos to n and calc best using the previous data
i.e., min of total_beacons-total_beacons_until_this_beacon+dp[present_beacon] all positions .

On izbanCodeforces Round #239 Editorial, 11 years ago
0

I can't understand this solution too.
There is O(n) soln for this
my solution > 13779488

On AndreySerguninCodeforces Round #310, 11 years ago
-21

This Problem and Case of Matryoshkas (Div2) are exactly same problems.

Dude, Read my comment properly.


i got Wrong Answer on Pretest 6. But my GCC Compiler shows the correct output required!

why gnu inbuilt pow function fails?

Nice Round :)

Cool One :D !!