We will hold AtCoder Beginner Contest 386.
- Contest URL: https://atcoder.jp/contests/abc386
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20241228T2100&p1=248
- Duration: 100 minutes
- Writer: physics0523, toam
- Tester: MMNMM, nok0
- Rated range: ~ 1999
- The point values: 100-200-350-425-500-525-600
We are looking forward to your participation!








why are you newbie atcoder-chan?
atcoder_official reminds me of sus on top contribution point.
This is the last atcoder contest of the year
Guess what will happen tomorrow:
Because of some serious problems, this contest might be the last abc this year. So please treasure this precious oppotunity!
is there any correlation between atcoder and cf rating ?? Like a multiple or something??
https://mirror.codeforces.com/blog/entry/93069
Isn't E just all combinations? Why is it giving TLE?
probably your not getting each answer fast enough
It's tricky — most implementations would be $$$O(K * combinations)$$$, which TLEs when K is close to N. You just have to do the combinations of $$$N-K$$$ elements in that case instead.
But calling the recursion this way should not tle right? my submission
It would be if you optimize your (n — i == left) case to $$$O(1)$$$, e.g. by precomputing suffix XORs. Right now it's $$$O(N)$$$ so it is not an optimization.
So for the n different recursive ends I'm running a loop of O(n) which is causing TLE, cool thanks!
either k will be too small or k will be too large.
in the case of large k you have to choose $$$n - k$$$ elements which will not be included in sequence
Accounting for the number of remaining elements to be picked and and number of elements left to be checked in the array should work right? my submission
61201371 Optimization in recursion:
Yeah I implemented the same but by using suff xor.
trash round
How to do G?
Let $$$S$$$ be the set of all possible graph, $$$W(G)$$$ be cost of MST of $$$G$$$, $$$T_{\leq x}(G)$$$ be the minimum spanning forest form by edges in $$$G$$$ with weight $$$\leq x$$$, $$$w_e$$$ be the weight of an edge. Then we have
Then the problem reduced to sth similar to this problem, and can be solved by dp.
From the official tutorial, $$$W(G) = \sum_{k=1}^M c(G_k) - M$$$.
I wonder if there is an official name for this formula. Or is there any online material to study it? Thank you!
You can just see the first line + first summation of second line above, that's how we get it.
spend too much time on D couldn't do E. Wack round
I solved A,B,D in 30 minutes, (skipped C) then I gazed at E for 15-20 minutes, without focusing on nCk <= 10^6. wasted 15-20 minutes for no reason.
Brutal :(
What do you know about brutalness?
32 seconds. damn
It was the same code
I think there is an issue with Problem D because I found a code which was wrong and it got AC. The code only checks the last
Wcell.https://atcoder.jp/contests/abc386/submissions/61207421
In this test case the code gives
Yesas the answer, instead ofNoAtcoder contests are really greats. I always get something new to learn and get so much fun.
who can show D answer of C++,thank
61171841
Hey can somebody explain the approach for E(Maximize Xor). How to do it.I got tle !
The key insight for solving this problem lie sin the constraints. The total number of combinations must be less than 10^6. This allows you to design a solution that operates in O(K*10^6) where K is the size of your set.
can you explain in detail
If K is closer to N than to 0, we can take N-K and xor every sum with xor of everything ("negate" selection). Now, if K>=5 then N<63, because binomial<1kk, we can enumerate all combinations with Gosper's hack directly. If K<5, we can directly loop over all selected values i,j,k,l (do not forget 0).
How to solve F?
Consider the normal edit distance DP with time complexity $$$O(|S||T|)$$$, i.e.
If you analysis it carefully, it's unnecessary to consider all states with edit distance $> K$, thus for each $$$i$$$, we only need to consider $$$dp[i][j]$$$ where $$$i - K \leq j \leq i + K$$$, which reduce the complexity into $$$O(|S|K)$$$.
QuestionProblem D-Diagonal SeparationSample Test 1:
W, then can we change that cell toBifi+1cell is blackB?W, then can we not change that cell toBif thei+1cell is whiteW?can anyone help me with problem D and share your code.