Samsam's blog

By Samsam, history, 8 years ago, In English

Hi,

Could someone please help me solving this mathematical expectation problem ?

and I would be thankful if there is a code too.

Full text and comments »

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

By Samsam, history, 8 years ago, In English

Hi,

I'm facing some difficulties in solving problems that need hard implementation

and I want to improve myself in solving such hard aspect, so could anybody please

give me some problems to train on ?

thanks :)

Full text and comments »

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

By Samsam, history, 8 years ago, In English

Hi,

I am not able to access the topcoder's wiki, and every time I sign in to the wiki

I get this error message:

A system error has occurred — our apologies!

Cause:

java.lang.NullPointerException at com.atlassian.confluence.user.ConfluenceLoginInterceptor.afterLogin(ConfluenceLoginInterceptor.java:34)

can anyone help me please ?

Full text and comments »

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

By Samsam, history, 8 years ago, In English

Hi,

I'm trying to improve myself in solving problems about probabilities and mathematical

expectation, but I find most of problems hard to me especially those problems where

I need to find the expected value, because I feel that every problem needs a way

to think about that is different from the other problems, and trying to apply

the formal definition of the expected value is always useless.

So, could you please provide me with a way to improve myself or some stuff to study from ?

Full text and comments »

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

By Samsam, history, 9 years ago, In English

I was trying to solve this problem on topcoder. The output for the problem is the probability that Jane wins the game, but my problem is that I think that the probabilty of each player to win the game is always 0.5 and that isn't correct according to the output of some given testcases in the problem. The reason of my thinking is that both players have the same number of turns and both of them have exactly the same choices to play. So I wonder if somebody could explain to me why the probabiltiy isn't always 0.5.

Full text and comments »

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

By Samsam, history, 10 years ago, In English

Hello everybody,

I'm trying to improve my level on codeforces, so I always try to solve hard problems for me

like C and D Div2 but in 95% I can't solve them my self so I read the tutorials and I

feel that I'm still in the same place after solving good number of C and D problems and I am still

not able to solve C in most cases.

I should tell you that I am practicing alone and I have no coach and just depending on

the web to learn.

So I will be thankful if you tell me how to practice and if there are any resources that I have to learn from?

Thanks.

Full text and comments »

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

By Samsam, history, 10 years ago, In English

Hello everybody, Could somebody provide me with a good tutorial for suffix array data structure?

Full text and comments »

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

By Samsam, 10 years ago, In English

Hello, I am solving this problem and

I am getting Wrong answer when submitting my solution even the results are true on my computer

I am getting:

Wrong answer on test 1 for Microsoft visual c++ 2010

Wrong answer on test 9 for GNU c++ 4.9.2

Wrong answer on test 9 for GNU c++11 4.9.2

Even my answer is correct in the three cases

So what could the problem be ?

Full text and comments »

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

By Samsam, 10 years ago, In English

Hello everybody, Could you please tell me how to search for a blog on CodeForces ?

Full text and comments »

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

By Samsam, 10 years ago, In English

Hello everyone,

I am searching for segment tree and binary indexed tree problems on CODEFORCES for training.

I am actually a beginner at these data structures.

So, could anybody suggest me some problems, please ?

Thanks alot.

Full text and comments »

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

By Samsam, 10 years ago, In English

Hello everyone, I am trying to solve this problem so I've read the tutorial and every thing is clear,but there is one thing that I couldn't understand: in the solution we used binary search to find the minimum value of c(a),so if the range is [L,R] and mid = (R+L)/2 then if we found that mid can't be a value c(a) because we have to change more than k elements then the binary search will be applied on the new range [mid+1,R],so the question is: why if we found that the mid can't be a value of c(a) because it needs making more than k changes then all the values of c(a) that is from the range [L,mid-1] will also cost more than k changes? Thanks a lot.

Full text and comments »

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

By Samsam, 10 years ago, In English

I always see problems that need to print the result of C(n,m) mod a prime number where C(n,m) = n!/(m!*(n-m)!) the factorial formula of binomial coefficients. I've searched for it and I found that I need to find the multiplicative inverse using extended Euclidean algorithm and I've learnt it. I hope if somebody could tell me the fastest way to find C(n,m) mod P (P is a prime) using extended Euclidean algorithm and I would be thankful if there was a code. Thanks a lot.

Full text and comments »

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

By Samsam, 11 years ago, In English

I have to get the sum of these terms (2 + 4 + 8 + 16 + ...... + 2^n) % (10^9 + 9). I know that the sum without the mod is given by the formula : 2*(1-2^n)/(1-2) = -2*(1-2^n) but I don't know how to get the sum mod 10^9 + 9. So please could you help me ?

Full text and comments »

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