We will hold AtCoder Beginner Contest 422.
- Contest URL: https://atcoder.jp/contests/abc422
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20250907T1310&p1=248
- Duration: 100 minutes
- Writer: MMNMM, Nyaan, kyopro_friends, sheyasutaka
- Tester: toam, kyopro_friends
- Rated range: ~ 1999
- The point values: 100-200-300-400-450-500-575
We are looking forward to your participation!








This new start time is very good.
It's no good for chinese!!!
Hope this round won't be as bad as the last one...
qp
Bro I cannot solve problem D.
I guess we can build answer recursively...
You can build the solution from the last step to first step.
You can start with [k], before that you can have [k/2,k-k/2], before that, you can have [(k/2)/2,(k/2)-(k/2)/2,(k-k/2)/2,(k-k/2)-(k-k/2)/2] and so on...
Today's problems after C were better than yesterday's ARC imo. Especially; the problem F >>
I guess they have swapped ARC and ABC :))
Has anybody solved using divide and conquer for E?? If successful, please share it.
The solution of C is always surprisingly short.
And, I used binary search like a dumb.
Sometimes is useful just implement the binary search (or just another idea) quickly instead of think if there would be a shorter or easier solution and try to prove it, no?
True.
Is there any particular way to solve problem E without using RNG?
shuffle points then try points with indices (0, 1), (2, 3), (3, 4)..
Submission
why this giving error , this problems like c are so bad just one line code if someone guess 10 sec to solve if someone not no matter what he do always wrong i first utilise the b then simply take contri of a and c , any case you think about ??
3 0 3 ans should be 2 (AAC + ACC)
Can you please explain me the solution for the problem E as in editorial they are mentioning the randomized approach but i didn't hear that , and one more thing that my approach to make a map of slope and y_intercept and then i will who are having the freq>n+1/2 then thay our answer but for that complexity will go upto n^2 and not allowed can you please help
Let's assume that there exist n/2 points that are on the same line (if not then the answer is NO and it's fine)
Then if you pick 2 random points from our set, there is a $$$(1/2)*(1/2)=1/4$$$ chance that both points that we picked are on that line.
So we just pick 2 random points, and check how many points are on the same line as these two. (That's easy to o in $$$O(n)$$$)
And we repeat this process multiple times to achieve good enough probability of success
For example if we pick 2 random points 100 times, the chance that we won't find such line is $$$(3/4)^{100}$$$ which is almost 0%. So if we didn't find such line after 100 iterations, then we can say the answer is NO
Why problem F couldn't be solved with Dijkstra?
The function which calculates the cost of a path in the graph does not satisfy the dp property.
More info here: https://codeforces.me/blog/entry/107810
Thanks!
It can be solved with Dijkstra.
https://atcoder.jp/contests/abc422/submissions/69142074
Interesting, what is this technique called? This does not look like pure Dijkstra.
dijkstra with pareto optimality
https://cs.stackexchange.com/questions/148005/set-of-pareto-optimal-paths-in-a-graph-where-edges-have-both-length-and-cost
Can anyone prove my solution for F? I claim that every vertex only have $$$m$$$ pairs of
(current weight, fuel used)being useful , but I can't prove it.my solution
all nice problem!!! althought I just solve 3,but solve the rest problem with Editorial help me learn a lot!!:)
True. Contests with nice problems back to back.
Can you please explain me the solution for the problem E as in editorial they are mentioning the randomized approach but i didn't hear that , and one more thing that my approach to make a map of slope and y_intercept and then i will who are having the freq>n+1/2 then thay our answer but for that complexity will go upto n^2 and not allowed can you please help
Read some probability theory and then read the editorial again.
Is it fair to have random in E? The same solution can be judged differently just by random.
Nope. Using a fixed seed can avoid this problem. Also, the error rate is significantly low, so it almost doesn't matter.
For problem D, first fill vector by $$$\frac{k}{2^n}$$$. Then keep incrementing numbers in even position by 1 alternating between left and right, continue till you have n%{2^k} remaining. If there is still some left then do the same for odd position. The imbalance will always be 1 when there is remainder other than 0.
Why this solution is incorrect??
The checker for question D has a major issue.
When $$$X=0$$$,I output 0 0 0 0......0
When $$$X\neq 0$$$,I output 1 0 0......0
But it is accepted!!!
So checker doesn't consider $$$sum=K$$$!!!
problem D spj maybe wrong? Without considering K.
https://atcoder.jp/contests/abc422/submissions/69146833
There is a discuss of D's checker was wrong :Portal
OAO 发帖人我认识(