Comments
On Inf_ZeroCodesprint-Quora, 14 years ago
0

The submissions have been reopened and you can submit your code which engineers form "Quora" will have a look at. The problem set is unique in that it takes a step ahead of normal programming contests by having problems that very closely relates to the engineering problems tackled at "Quora" itself.

Good Luck and have fun!!

hey , have some t-shirts for the wizardy during contest. like one for the fastest submission,one for the last submission :) ,etc....
On HartaDynamic Programming Type, 15 years ago
0
Is there something wrong with z-trening!!!!
please provide some alternative(judge) for the z-trening problems in above list
On ConnectorCodeforces Beta Round #75, 15 years ago
0
Anyone for Div-2 E explanation .... plz
On ir5Codeforces Beta Round #71, 15 years ago
0
I suspected 0(n*m*m ~ 10^7) might hamper.Instead I used Kmp for preprocessing then applied DP . It costed me time :(
On ir5Codeforces Beta Round #71, 15 years ago
+7
Admin has hinted us to keep a good book of mathematics during the contest !!!
We can get optimal number of balls by placing them only at boundary of one of the two smaller sides. Reason being , any point on any other boundary can be reached by some point from "the boundary" said above.

Say , in a x b grid with a > b "the boundary" is the left wall i.e 1st column.

Now trace the path of a ball travelling from from a point at "the boundary" back to some point on "the boundary". You will observe that ball goes and comes back from the same point at  (a - b + 1)th column.

Hence , for tracing the paths in order to find conflicting points at "the boundary" we don't  require columns farther that (a - b + 1)th column.

This is why we can say a = a - b + 1;
For problem C:

In an nxn board , a ball starting from any point on a boundary comes backs to the same point without touching any other ball on the same boundary.

So , it's clear that nxn board is equivalent to nx1 board(for placing the balls) , in which case answer is n.

let a and b be the sides of board,

So if a > b keep on shrinking bxb blocks to bx1 block.

Code:
while( a > 1 && b > 1 ){
                if( a > b)  a = a - (b - 1);
                else          b = b - (a - 1);

return a + b - 1;
Why can't i view the problem statement in english................................