Comments

It is unnessesary. k <= n is stated

0

oh, then I should read solution but it is not available...

+26

I think the difficulty was reasonable if two people cannot share the same position and $$$N \le 10^5$$$ as Div2D/Div1B.

0

C,

Actually, We can always make all part as zero with this.

int Y, X; cin >> Y >> X; cout << Y * X << endl;
for (int y = 0; y < Y; y++) for (int x = 0; x < X; x++)
    cout << y * (1ll << 32) + x << (x == X - 1 ? "\n" : " ");
0

Let U be a guinea pig whose gender is not yet known.

If $$$x=1$$$, let $$$U:=U+1$$$.

If $$$x=2$$$, let $$$K$$$ be the number of guinea pigs whose gender is known.

In the state of $$$U$$$, it must always be in a cage. For $$$K$$$, $$$⌈K/2⌉$$$ cages are needed.

This is because in the worst case, the gender must be determined in order male, female, male, etc., and eventually $$$⌈K/2⌉$$$ cages are needed.

However, since cages are not lost once they are bought, the maximum value of the answer is updated as follows.

ans = max(ans, k + ceil(t/2))

D1

I see applying Operation 2 $$$n$$$ or $$$n-1$$$ times from begin.

then, $$$k-(n-(n+k) ~\text{mod}~ 2)-1$$$ should be $$$k-(n-(n+k) ~\text{mod}~ 2)+1$$$ ?

Or, $$$k-n+1 + (n+k) \text{mod}~2$$$

Thank you so much

0

His all submissions in this contest are shrinked deliberately. I know it is rule violation. 130676197

+5

I Think, in problem A, ans should be "H / (x + y)" multiple by 2

In the definition of problem, the probability is about "count of all race until P is selected" So, select C or M means one more race. So +1