# | User | Rating |
---|---|---|

1 | MiFaFaOvO | 3681 |

2 | tourist | 3669 |

3 | apiadu | 3397 |

4 | TLE | 3374 |

5 | Um_nik | 3358 |

6 | 300iq | 3317 |

7 | maroonrk | 3232 |

8 | Benq | 3230 |

9 | LHiC | 3229 |

10 | 1919810 | 3203 |

# | User | Contrib. |
---|---|---|

1 | antontrygubO_o | 192 |

2 | Errichto | 185 |

3 | tourist | 182 |

4 | vovuh | 170 |

5 | pikmike | 169 |

6 | Radewoosh | 164 |

7 | ko_osaga | 162 |

8 | Um_nik | 161 |

9 | 300iq | 156 |

10 | rng_58 | 154 |

↑

↓

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/29/2020 06:48:47 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

Thank you for your nice problem set, 300iq teacher! And could you provide the Editorial?

Sure! Added it to the blog.

Whats the difficulty level? do you have editorials ?

Wow, the English is really good in these problem statements! Thanks a lot.

I have friends with good English skills ;)

wtf how to be friend with 300iq

learn english

hi sirs... my english not so good, is that why lgm and other codeforces competitor don't replied to me ?? thanks sirs for the help

i have the same problems too ... :(

any tips?

Hey, I don't have too much experience, but I've gotten a lot of success asking people for help with good grammar.

Some other things that help are: 1.) A clearly defined problem. 2.) Some code (if applicable). 3.) An explanation of what you've done so far, and of your code (even if it's easy for you to read, it's not always easy).

Also read this: https://codeforces.com/blog/entry/64993

colors in the blog reminds me of something very related to me <3

My pseudo-solution for EFirst until there are two equal elements erase both of them. Now if we are left with less than $$$50$$$ elements we can for each $$$x$$$ calculate $$$(a_1 \mod x) \oplus (a_2 \mod x) \oplus \ldots \oplus (a_k \mod x)$$$ directly and check if it equals 0.

If not we compute prefix xors, to be able to compute in constant time parity of numbers in any interval. Now for each $$$x$$$ we iterate over all bits $$$b$$$ such that $$$2^b \geq x$$$ in decreasing order and for each we want to know parity of count of numbers such, that $$$b$$$-th bit is set in $$$a_i \mod (x + 1)$$$. To do this we can run through all intervals $$$[l, r) = [a(x + 1), (a + 1)(x + 1))$$$ and in each of them set of numbers with $$$b$$$-th bit set is exactly $$$[l + b, l + 2b), [l + 3b, l + 4b), \ldots, [l + (2k+1)b, r)$$$, which is $$$1$$$ interval on first run with largest possible $$$b$$$ at most $$$2$$$ on second, $$$4$$$ on third etc. Now since $$$k$$$ is large, the function $$$(a_1 \mod x) \oplus (a_2 \mod x) \oplus \ldots \oplus (a_k \mod x)$$$ looks random, so on average the first run will happen for each $$$x$$$, second for half of them, third for one fourth, and so on, which adds to total $$$O(n \log ^2 n)$$$

Except it's bullshit, because for example if after erasing numbers we are left with integers from $$$[4\cdot 10^5, 5\cdot 10^5)$$$ if we pick $$$x$$$ such that $$$2x \leq 4\cdot 10^5, 3x > 5\cdot 10^5$$$, we're left with numbers from $$$[4\cdot 10^5 - 2x, 5\cdot 10^5 - 2x)$$$, which is sequence of consecutive numbers of length divisible by $$$4$$$, least of which is even, so since $$$2x \oplus (2x + 1) \oplus (2x + 2) \oplus (2x + 3) = 0$$$ their xor is $$$0$$$, so my solution will run through all iterations for all such $$$x$$$-es and will take total of $$$O(n^2)$$$.

Fortunately there were only random testcases, so reasoning based on randomness of function $$$(a_1 \mod x) \oplus (a_2 \mod x) \oplus \ldots \oplus (a_k \mod x)$$$ holds.