### 123gjweq2's blog

By 123gjweq2, 5 weeks ago,

I thought of this problem today, and since I don't really have much problem-creating experience, I would like to hear the opinions of experienced problem creators on whether or not it would be a good div. 2 A. Feel free to try it if you would like. I have added the solution.

Problem:

One day, $n$ people are made aware of the website codeforces.com. Let's call this day day $0$. The day after day $0$ is called day $1$, the day after that is day $2$, and so on. If you randomly select $1$ of these $n$ people, what is the expected value of the absolute difference between the day they were made aware of codeforces and the day they created a codeforces account? If the expected value is too big to fit inside a 32-bit integer, output $-1$.

Input:

The first line of each test, $t$, is the number of testcases $(0 \le t \le 10^3)$. Each testcase consists of a single integer, $n$ $(1 \le n \le 10^6)$.

Output:

For each testcase, print the expected value. It can be shown that if the expected value is less than the largest 32-bit integer, the expected value is an integer itself.

solution
code (python)
• -31

 » 5 weeks ago, # |   +48 I am a newbie, but this problem is more like an April's Fools day contest problem.
 » 5 weeks ago, # |   +9 ermmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
•  » » 5 weeks ago, # ^ |   -13 what the sigma
 » 5 weeks ago, # | ← Rev. 2 →   +10 This is pretty atrocious. For one, your assumption is not justified from the problem statement. Why should people not making an account even be considered positive infinite difference?Furthermore, all div 2A requires some computation. This problem can be solved without even reading the input (aside from T). You don't even need line two in your solution... Also, by convention, almost all problems generally have sample cases with explanation. This would give away this problem instantly. (EDIT: This is probably a joke, sorry for over-reacting lol)
•  » » 5 weeks ago, # ^ |   +22
•  » » » 5 weeks ago, # ^ |   0 don't worry, if this even seems bad you can make another and post it in the comments.
 » 5 weeks ago, # |   +21 Truly an iq problem.
 » 5 weeks ago, # |   0 beautiful problem! like a Div 2 F
•  » » 5 weeks ago, # ^ |   +2 like a div. 2 fart.
 » 5 weeks ago, # |   +1 This could be a good troll problem (I think it's slightly troll, but a bit less troll than the recent 1234 1234 1234 problem D). However, the fact that you just posted it on your blog means it will never be a codeforces problem.
 » 5 weeks ago, # |   +1 there is a nonzero chance they will never create an account therefore the expected value is zero ?? I don't think that's correct