Sanzee's blog

By Sanzee, 9 years ago, In English

I am stuck in this problem for some time now :( :(. it will be very helpful if anyone can give me some hint.

problem link : problem

My idea :

lets consider each light individually.
Let p is the probability of selecting the light. this p can be found easily by calculating each dimension of the 3d cube separately.

Now the expectation for a light will be sum over i(1 to k) : p^i * (1-p)^(k-i). (K is the number of turns) Now we only need to add the terms where i is odd as only then the light will be ON.

calculating this for all the bulbs is obviously time out :( :( :( is there any close form? i can't find it :( :( :(

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By Sanzee, 11 years ago, In English

I was trying this problem 234C My code failed in test case 1 :( :( judge says that my code is not giving any output at all for case 1 :( :( :( I checked my code in the custom test section with that case and found that my code is giving the right answer.

My Code : 3582788

found the problem :) :) for this problem the input/output tech was from file

thanks

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By Sanzee, 13 years ago, In English
we  are working on a educational OJ .We are facing difficulty finding total memory used by a java code in Linux (CenOS). As Linux process table shows the sum of the JVM memory and the code memory.How can I find the specific memory used by a java code ??????
please help.



Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it