Comments
On ManikantanV → Check friends list, 6 years ago
0

Good job digging this post from the grave. If I'm not wrong, the intention was to identify anyone I might know who were following me and follow them in return

+3

F is gonna wreck my rating. But I solved D at least ...

Thanks! But I don't understand why enforcing HTTPS needs to be an option

I tried a naive solution by finding nearest and farthest radial points of the polygon. Guess there is more to it. This approach works for the illustrations

Will the tests which lead to successful hacks be used for system testing?

On rafalk342 → How to prove this strategy?, 11 years ago
-22

Chuck it. I misunderstood the question

On rafalk342 → How to prove this strategy?, 11 years ago
-22

The proof is simple:

Assume n numbers in the array:

You can prove that 1 number will be added n times

1 number will be added n-1 times

and so on till

1 number will be added 1 time

So you have to minimise sum,where

sum = n*(a[x1]) + (n-1)*(a[x2]) + .... + 1*(a[xn])

Since we must minimise, obvious solution to sort the array and set xi = i and find sum

Hope it is clear

0

E was nice w.r.t the way in which DP table had to be filled :D

On ZhNV → Codeforces Round #324 (Div. 2), 11 years ago
0

No.4 cannot be expressed by your logic

On josdas → Codeforces Round #316 (Div. 2), 11 years ago
0

Room topper for the first time :D

On vsanjay_nitdgp → map doubt, 11 years ago
0

Read about Euler Path

king_of_hackers? Probably.

king_of_memes? Yeah ;)

On AndreySergunin → Codeforces Round #310, 11 years ago
0

Hacking is my mistake, okay. But still, if 2 hacks make my score less than someone whose submission time is ages(people who submitted near end have higher points) after me, I feel there is an imbalance somewhere.

On AndreySergunin → Codeforces Round #310, 11 years ago
+1

In my case, I solved problem A in 30 mins, which has 171 points (after conversion to 250). I missed 2 hacks , which reduces score to 71 points and puts me at the fag end of the leaderboard

On AndreySergunin → Codeforces Round #310, 11 years ago
+6

It kind of discourages hacking and not much value for speed is given either. Difference of +100 initally due to early submission time is now like +10 or +20. But 2 faults in hacking gives -100 difference direct.

On AndreySergunin → Codeforces Round #310, 11 years ago
+18

Scoring system is dynamic. But points deduction is absolute(-50) .. and when the score keeps decreasing, -100 pushes the score like hundreds of places behind. Please take a look Mike

On Lewin → Codeforces Round #309 Editorial, 11 years ago
0

Here is my code,implementing the same, in case what is said is not clear http://codeforces.me/contest/553/submission/11751489

On Lewin → Codeforces Round #309 Editorial, 11 years ago
0

Approach to Div 1 — Problem A using pure DP:

Let dp[i][j] denote number of ways to place first i balls such that ending position of i'th ball is j . Let total[] be prefix sum of number of balls upto ith color from color 1.

Now to find dp[i][j], consider all values from dp[i-1][j-1] to dp[i-1][total[i-1]]. Consider one such value dp[i-1][x]. Now,we can say that all balls from position x+1 to j can be filled only using ball color i (as of now). Plus we have spaces, which are not filled by balls of colors 1 to i-1 in positions 1 to x. Total number of these voids can be found easily with prefix sum.

dp[ i ][ j ] = ( Number of voids -1 ) C ( Number of balls of color i -1) We subtract 1 to indicate last ball of color i is fixed at j. We can do pascal's triangle pre computation again using simple DP

0

My original code failed to decrement modify[i] whenever possible with each used stick when h[i]>=4. Everything else was in order.Thanks for pointing out Corrected code is here

0

Thanks :) .. i failed to apply greedy in the sense that it would be sensible to use modified sticks first to make rectangles in place of original length sticks.

+1

Problem A was awesome :) . Got my locked code hacked, but still got 700 points from hacks :D

On Rebryk → Codeforces Round #291 (Div. 2), 12 years ago
+13

Why is rating update taking so long?

On Rebryk → Codeforces Round #291 (Div. 2), 12 years ago
-13

Read the problem statement. You should not have a zero at starting index after performing inversions. 9 is not allowed as it is actually "09", which has trailing zeroes

On Rebryk → Codeforces Round #291 (Div. 2), 12 years ago
0

I got TLE in test 28 :( .. my time complexity is O(m * l * log(n)) where, l is length of string in each query. m,n are from problem statement. Can anyone explain how this doesn't run in the time limits? Upd: (m*l)<=6*10^5 (from statement) and log n cannot exceed 18

On Rebryk → Codeforces Round #291 (Div. 2), 12 years ago
0

pretests are a bit weak, i think. I got pretests passed in my first approach where space complexity was O(n^2) [Unnecessary though]

On Rebryk → Codeforces Round #291 (Div. 2), 12 years ago
0

A hashmap is enough, given the constraints, i think. My approach uses m.log(n)

On Rebryk → Codeforces Round #291 (Div. 2), 12 years ago
+1

Hopeful of being a room winner for the first time :)

Is a DFS tree equivalent to a Union Find structure created using given edge pairs ?I am relatively new to graphs and find them similar :)

And for problem "Count palindromes" , even precomputation can be simplified so as to include only the necessary 96 combinations.It can be done in O(24 * 6) time. 24 — For hours and seconds(since palindrome) while minutes can take only the values of 00,11,22,33,44,55(hence 6). Then we can simple iterate the 96 combinations and report answers :)

Problem J — Really good one :) .. Missed AC in contest due to slow IO :/

I also did the same. The number of coaches is less than or equal to 50. So O(n^2) will pass easily

I didn't quite figure out the significance of placing the book on top after reading initially. Thanks for the answer!

On ManikantanV → Unusual runtime error, 12 years ago
0

I failed to account for one or two cases where index is out of range. Problem has been resolved