https://codeforces.me/contest/2233/submission/377920491
crazy solution by PCTprobability ( how did you even think of this )
It is not hackable practicially but theoretically hackable.
but i still dont know the proof lol.
| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 143 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 135 |
| 8 | maroonrk | 133 |
| 9 | BledDest | 132 |
| 10 | qwexd | 129 |
https://codeforces.me/contest/2233/submission/377920491
crazy solution by PCTprobability ( how did you even think of this )
It is not hackable practicially but theoretically hackable.
but i still dont know the proof lol.
| Name |
|---|



Probably not theoretically hackable. Even though
rand()is not seeded and you can perfectly predict all values of it in advance, the chance that an input exists where it fails like 100 times in a row (which is what you would need for it to TLE) is very close to zero.I'm not sure how easy it is to prove that a random shuffle guarantees a certain % chance of success (probably find the chance that the four 1s collide, and then multiply by $$$n$$$ with union bound)
Upd: with simple python simulation
With 5M trials for n = 20000 I got a failure chance of 0.000296 per number, or at most 583% chance of failure total (this doesn't help). So I'm not sure how to prove the full statement. Maybe you can assume independence (although that's sketchy) and that will make the odds better
You can check official editorial of B, it mentioned some information about randomized solution that may help you.
the template code just keeps going .....
ikrr crazyy stuff
this was my solution 377963327
This was my simple solution 377941553
This was my simpler solution 377935518
I was acually trying to implement something similar at first but rather than sum+=i i did something like sum=i which messed up my soln and i had to waste time thinking of another approach
My solution is the most simple I believe 377964093
ok
Okay bro thanks for telling.
Before: "LGMs solve hard problems with elegant solutions." After seeing this code: "Never mind."