Problem 1: 2263C1 - Floor of MEX (Easy Version)
$$$O(n^2)$$$ solution: 390532511
Code
kondasujay2 CutSandstone sukon
Problem 2: 2269C - K Is Important
$$$O(n^2)$$$ solution: 392233470
Code
Hamed_Ghaffari sweetweasel eren__ _R00T
The reason? Because of $$$n \le 10^5$$$, not $$$2 \cdot 10^5$$$, PLEASE all future authors use $$$n \le 2 \cdot 10^5$$$ PLEASE








Are these really n^2 if the first one ran in 46ms? Also killing brute / heuristic solutions I think is a part of the testing process. I gave up and tried to submit an AVX solution to d1C this morning and it made it to pretest 11 but died then
the first one ran in 46ms, but the max test case could be up to >1500ms https://codeforces.me/blog/entry/156688#comment-1392295
Not crazy enough. Just watch this, We can solve *3100 in $$$O(n^2)$$$ with AVX.
Since when did welcome home chtholly become 3100
code 1: use difference array, too trivial optimization it doesn't matter
code 2: an optimization would be using fenwick tree to count erased elements, but it's clearly overkill for c div 2 and is probably a nontrivial optimization
also the same problem happened in 1425I, 2242F, 1777F (1 sec for AVX out of 8), etc...
but it should TLE, but it does not, thats the issue
Can someone tell me what is exactly AVX? And why it would make a difference when n<=2e5?
AVX is a specific version of SIMD (single instruction multiple data)
It lets the computer perform 512 (or 256, if your processor is extremely old) bit of operations at once. I.e, it can perform 16 32-bit operations in one clock cycle. This essentially decreases constant factor by a factor of 1/16 so a solution running in 16s will run in 1s. Of course the improvmenet is not going to be exactly like this but it allows some cheese strats.
It is similar to how Bitset lets you perform 01 Knapsack in O(n²/64) (the computer operates on 64 bits at a time which is 64x faster)
Right, but you didn't tell the difference between n is being 1e5 or 2e5
n = 1e5 has n² = 1e10, divided by 16 is around 6.25e8,which can barely pass. n = 2e5 has n² = 4e10 which is around 2e9 when divided and is unlikely to pass even with SIMD
Not sure where the e15 came from but I'm pretty sure 2e5 squared is 4e10. If that was just a typo, mb
n = 1e5 is the annoying cutoff. Same loop at 2e5 is an obvious TLE, and at 5e4 nobody cares. 1e5 is where a sloppy n^2 still sneaks under 2 seconds and then the comments turn into SIMD arguments.
I think in both of those problems, I solved using a segment tree lol.
Not entirely related, but a solution in n*q with n and q<=200000 AC in an IOI problem https://oj.uz/submission/826888