We will hold UNIQUE VISION Programming Contest 2025 Christmas (AtCoder Beginner Contest 437).
- Contest URL: https://atcoder.jp/contests/abc437
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20251220T2100&p1=248
- Duration: 100 minutes
- Writer: toam, sheyasutaka, sounansya
- Tester: physics0523, kyopro_friends, toam
- Rated range: ~ 1999
- The point values: 100-200-350-400-450-500-625
We are looking forward to your participation!








2 years later we can have abc on Christmas Day.
I wish i could solve 6 problems
The most of players solve 6 problems, but there are only few players solve G.
Wow, good luck everyone
Hope there'll be some interesting problems and a clear discussing environment.
It's more silent than last time.That's good news.
haha
Hope I can solve E
有人么
No if I'm not a human.
I mean yes, there's people.
Don't post irrelevant comments,especially by langugue which isn't used by most people.
I think Chinese is used by many people.
But not most of people in CodeForces
I hope I do good this time. Good luck everyone!
Why the comments is few?(Is there any Chinese person here?).
Easy D,F.Hard C,E,G.
Easy D.Hard C.
Easy F (if you have template), Hard D and E.
You're right
all problems except G are easy. problemsetters have become too lazy. can't even put an intermediate problem on F
Disagree.I think E is hard too.
Many people cleared the early problems at warp speed. I was two blocks behind just reading—anyway, good match, and Merry Christmas!
Typing competition to F
In the editorial its mentioned...
This is a widely known trick when considering Manhattan distance: we can regard that we rotated the plane by 45 degrees.I don't know about it, and I want to know it in detail, want to solve more question related to it. Can you please share ?
I am able to understand the editorial. I think, I can solve the problem without rotating plane...
I seem to grasp the concept of the "Rotate the plane by 45 degree" . but why ? what are we accomplishing from that ?
That "tip" is (for this exercise) straight up useless. The exercise is solvable by noticing that the maximum manhattan distance can be written as the max of 4 expressions, each one computable with a single segment tree query. No need to understand plane rotations or anything.
yeah,
abs(x1 - x2) + abs(y1 - y2)can be one of those 4:(x - x2) + (y - y2)(- x + x2) + (y - y2)(x - x2) + (- y + y2)(- x + x2) + (- y + y2)You can save most useful pairs for all those 4 cases if you seperate them as
(x + y) + (- x2 - y2)etc. At the end you just need to find max of those 4 for the given(x, y).You can read about it from here: cp-algorithms
Great problem. Merry Christmas!
E was a beautiful implementation problem but how tf does it have so many solves? It surely wasn't that easy to implement
Hey I tried to do a conventional dfs by considering the thing as a graph, but I got WA. I don't see what could go wrong, it passed half the test cases.
Could you help?
input:
Your code output :
2 3 5 4 1Accept output :
2 3 4 5 1So I suggest you using trie to solve this problem.
Oh that is a very smart test case, thanks
Could anyone give me a hint about problem E?
Trie
what was that 1 failing case on F ? anybody know ?
weird... but true... I use that basic recursive segtree and long long for most part, I stress test too with the accepted solution of participant to find bug, but couldn't find anything!!!!!! that make mine gave wa(bug in code)... 😭 so I will have to forever live not knowing why and have to always paranoid that 💀 my segment tree implementation was maybe wrong & actually bug all along and could fuck me up at some other random time like this 🥀🥀, maybe.. maybe not, I will never know why its bug..., this is truly a curse, I think I'm gonna have PTSD now every time I use it...
chatgpt can solve G easily
Still recall big shot.
In problem E, is it guaranteed that x_i would not reference to the seqeunce that was yet built during the input(i.e is input ordered)? I was sensing trie, but could not implement on time.
yeah it was given that xi < i
Regarding ABC G, is it possible to combine DP with divide and conquer?
Approach: In the DP part, use 8 states to represent the possible states in which this subtree can be disconnected from its parent node (the root of the subtree). For each node, evaluate the states of its child nodes to make a judgment.
In the divide-and-conquer part, recursively process from the root down to the child nodes. For a parent node, determine the disconnection state for each subtree by adding constraints, and split the subtree internally as well as the subtree from its parent based on these constraints.
Is this approach feasible?
Translate by deepseek.
I checked the submission records for problem G. Some of them contained heavily commented code that aligns with my approach, but the implementation, as I expected, was extremely complex. I don't think I could have completed them during the contest.
However, those participants using AI have confirmed that my approach is correct.
Translate by deepseek.
I don't know why the time complexity of F is O(n*logn), not O(n*logn^2) In other words, can the segment tree store only one number as information? It's supposed to be a whole set, and it carries a log
There's no need for any set. Four segment trees are enough.
Build the 4 segment trees (s1, s2, s3, s4) such that
s1[i] = +x+y
s2[i] = +x-y
s3[i] = -x+y
s4[i] = -x-y
And then you can compute the queries by querying minimum on [L, R] over all segment trees.
I got you. I was stupid then.
I thought that when deleting a point, the seg-tree can't get the max when only storing one value. Only a deletable-priority-queue/set can handle that.
however, only one point will be changed one time, and the seg-tree can push_up...
As a result, I set up eight priority-queues(four are for deleting) at every node of the seg-tree.
Thank you very much.
According to the solution of question G, two points with edges can be matched 6 times. Why does this not lead to bugs
Oh, I got it
Good contest. I solved A-F
I think E is not easy enough for 1954(2%) of the competitors to solve....I believe 1/3 of them are GPTers.
And how E in a human view?
What is "human view"?
Not GPT's thought.
Consider building a trie for those sequences, it's easy to implement. And consider how to determine the order? Obviously we can use dfs. More specifically, dfs the small son first and the big son after.
Why small son first?
How can we think to solve the D type question? Any hint would be really helpful !
Can someone help with why my solution to D fails :