We will hold AtCoder Beginner Contest 436.
- Contest URL: https://atcoder.jp/contests/abc436
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20251213T2100&p1=248
- Duration: 100 minutes
- Writer: yuto1115, MMNMM, evima
- Tester: toam, Nyaan
- Rated range: ~ 1999
- The point values: 100-200-300-400-475-500-600
We are looking forward to your participation!








When is the new judge launched for old problems?
I hope this will come soon.
front row support!
Hope I can solve 5 probelms.
AtCoder Beginner Contest 436 ❌ AtCheater Beginner Contest 436 ✅ AtCoder Talent Contest ✅
Felt more like a contest of who could “get help” faster. Too many solve times looked… unusual—like a duel of superpowered beings. Is this a programming contest or a cheating contest?
AtCoder: Xavier’s School for Gifted Speed‑solvers (and their “special” powers).
It looks like the testers knew a near-duplicate for G, where it is trivial to adapt the solution for the other task (check second link of G editorials). Doesn't this practically warrant an unrated contest?
$200 per month school fees
Stop spamming off-topic please, none of the writer/tester mentioned Nanjing Massacre or Japanese invasion.
why there are so many solves on F, i don't think it is that easy
Maybe cheaters.
I think it is as easy as CF div2 C...?
upd: Sorry for inproper words; maybe I underestimated the difficulty of the coming-up-with-the-approach part. Here's the link to my solution.
maybe the same difficulty as div2 D, it requires data structures.
Please stop posting about the Nanjing Massacre.
First, this content is unrelated to the contest.
Second, some comments have already shown confrontational and hateful emotions. If we look at this from another perspective: if, under the announcement of a contest held in China, a large number of users repeatedly posted off-topic historical or political slogans with violent implications, how would the organizers feel? They would not only be hurt by this, but would also have to spend extra time removing inappropriate comments, which directly affects the efficiency of handling legitimate questions and feedback.
If you wish to commemorate history or express personal or political views, please do so on more appropriate social platforms (such as Bilibili or Weibo). Here, please respect the contest, respect other participants, and respect the basic order of this community.
Whats the point of problem G? Search-skills check?
Codeforces is not an appropriate platform for expressing patriotism.
And please use English, as using other languages may confuse readers.
I genuinely don’t understand why comments like these receive upvotes.
Absolutely agree.
I genuinely don’t understand why comments like these receive upvotes.
Agree, except I dispute calling it patriotism.
That's extreme nationalism, or something even worse.
Patriots love their homeland and their fellow citizens and treat their country's history with seriousness. In these trolls I see none of these.
Agreed. This is an academic website.
It was the first time for me to solve E in an abc. I was so excited :)
wtf G BM??? anyone has easier solution
When ABC problem EX disappeared, problem G then become the problem EX (?)
My solution uses a pure DP, with a small optimization using NTT.
Let
We compare $$$S$$$ with $$$M$$$ bit by bit. Suppose we have already processed the lowest $$$i$$$ bits of both $$$S$$$ and $$$M$$$. Let $$$\text{sign}\in{0,1}$$$ indicate the current comparison result: $$$\text{sign}=0$$$ means "$$$S\le M$$$ so far", and $$$\text{sign}=1$$$ means "$$$S \gt M$$$ so far". Since the lowest $$$i$$$ bits have already been handled, storing them in the state is unnecessary.
Define the DP state
When transitioning to $$$f_{i+1}$$$, we choose a subset of indices
to turn on the $$$i$$$-th bit of each corresponding $$$x_{i_j}$$$. Let $$$\text{coef}(s)$$$ be the number of ways to choose a subset of $$$I$$$ such that the sum of the chosen values equals $$$s$$$.
Define the bit function
The transition is
Let
If $$$\operatorname{bit}(\text{newSum},i)=\operatorname{bit}(M,i)$$$, then $$$\text{newSign}$$$ depends on the previous comparison (i.e. keep $$$\text{newSign}=\text{sign}$$$). Otherwise,
The final answer is
The $$$sum$$$ state is always in range $$$[0, 2 \times 100^2)$$$. The current time complexity is $$$\mathcal{O}(60\cdot (100^2)^2)$$$. To optimize the transitions, we use NTT to speed up the convolution.
The final time complexity is $$$\mathcal{O}(60 \cdot 100^2 \cdot \log_2 (100^2))$$$
My code
How to solve c? Any help?
You can just use simulation,use map <pair <int,int> ,int> mp. And if mp[x][y] = 1 it means that (x,y) cell is occupied. Then when u are getting the query just check cells (r,c),(r + 1,c),(r,c + 1),(r + 1,c + 1) If any of them is occupied you can't do it Else do it and make all of them occupied Link to my implementation : https://atcoder.jp/contests/abc436/submissions/71662097 (My time + memory complexity is very big ,maybe there is much easier solution) :)
Thanks PokemonMaster...Much appreciated..
we can turn $$$(r,c)$$$ into $$$r*(1 \times 10^9 + 2)+c$$$ , use a set to save it and use 'set::lower_bound' to check.
warning : some process value need long long to save,or the program will return wrong answer
update:delete surplus (
Thank you. Also instead of storing like this Can we not use set of pairs and than check whether that pair and its friend already exits??? Can you please elaborate how this is more usefull than the other approach?
For my solution,it's easier to achieve and better in time complexity than using a pair,but it can't be used in some problem which can solved by pair.
Although problem E and F were comparatively easy than usual ABC's but this was the first time I managed to solve A-F!
How to solve G? Looks like it had a lot of solves.
Use NTT for fast polynomial convolution, apply an even/odd decomposition, and finish with a Bostan–Mori evaluation.
Haha, no idea what any of that is. Thanks though!
what the fuck are these comments
Easy Solution E: https://youtu.be/GlaP_8TmxfU
Stop shitposting. You guys keep posting something like "勿忘国耻"(Yes I'm Chinese so I know what it means) , but you don't even care about that, you are just about contributions and the sense of "Oh I'm a really good people".
Now CodeForces users give you lots of downvotes and you will be disabled soon. That's great XD
Look at the first person who got AC on today's Problem E. This person's name is: nanjing massacre
But this person used AI not to bring glory to the country but to disgrace it
How to determine if a person is using AI?
~300 contestants know the BM algorithm before the end of the contest??????????
300 contestants? 300 AI users!
(not excluding some contestants who already knows BM, but in abc contestants, the number obviously can't reach 300.)
Nice problems , i liked d one especially, good bfs+some data structure for optimization thanks
Tojo's soul is on the Sanae
How to solve problem G?
Use NTT for fast polynomial convolution, apply an even/odd decomposition, and finish with a BM evaluation. by likely
B>C D>E
man... to me A<B<C<D=F except E, I absolutely have no idea how yall find it so easy 😭 , I AC it in contest purely by random guessing then the random bs magic just work... 🥀 , difficulty being so real subjective man...
I got the idea by pure guessing, but was able to proof its correctness. The idea in itself is extremely basic, just finding the size of each connected component. But the way to get this idea requires so much creativity. Also, E's statement was really bad as I had to read it literally 20 times to understand!
I aked this contest but let me say ABCs are getting worse. We can easily find a similar question in Luogu:B3940 and one for D in Luogu:AT_abc184_e(even it's just Atcoder itself's). And obviously,many are using AI to AK this contest,but they don't even heard about BM or NTT in problem G,they just copied the code from chatgpt or deepseek.That's very bad.
[Deleted]
I can't solve G, How to solve it?
What is NTT? I just know WTT.
what is even WTT ? I don't even know any of both
Number Theoretic Transform. It's about polynomial.
You can easily search for it in any browser.
Atcoder Beginner Contest -> AI Beat Contest.
true... like what the fuck is even Bostan-Mori evaluation never heard it before in my life(I'm not even mad, I'm just flabergasted cuz I never heard such a thing and say it out of the love for the game 🥀)
Why are you guys discussing something unrelated? after all this is comments ABOUT A CONTEST
just in my opinion: statement of F is really hard to understand, which makes me spend more time to accept it, why cant you present this easy problem in a clearer statement?
I also think it was poorly written. I couldn't make sense of it despite reading many times
I have read everyone's comments and know that I was wrong. I will no longer make extreme nationalist remarks. How can I stop the damage in time? If I don't, I will be overwhelmed by a lot of downvotes.
just shut the f*ck up and you will be fine
i think his behavior is wrong and unsuitable but your need to keep politeness. Not only him but also everyone.
When these fking ultra-nationalism pupils shut up and go to promote themselves instead of expressing these shameless comments to be self-moved?
Grid, Grid and Grid why??
Can i get some hints for the F please .
Hint: For $$$i\in[1,n]$$$, considers the number of photos whose maximum value is $$$B_i$$$.
Let $$$l_i$$$ be the number of $$$j$$$ that meets $$$1 \le j \lt i$$$ and $$$B_j \lt B_i$$$, $$$r_i$$$ be the number of $$$j$$$ that meets $$$i \lt j \le n$$$ and $$$B_j \lt B_i$$$, then the count is $$$(l_i + 1)(r_i+1)$$$.
(Because having that $$$B[i]$$$ is the greatest number in the interval, we can assume $$$b=B_i$$$, then only values smaller than $$$B_i$$$ will be considered.)
So the final answer is $$$\sum_{i=1}^n (l_i+1)(r_i+1)$$$, where $$$l_i, r_i$$$ can be calculated by BIT(Binary Indexed Tree).
Thanks alot. it's a nice idea but how did you comeup with the idea of fixing maximum.
How to solve E D:
You can group the elements in the array into some cycles by computing for each element where they should be(their value),the number of swap to make the array sorted will be length-1, and the answer will be the sum of C(length of the cycle,2).
To understand it, there is some cases, let’s call the elements swapped in the first swap a and b:
1.both a and b are placed to where they should be. This won’t happen or else they won’t be in the same cycle, unless the length is 0 which has no contribution to the answer.
2.one of a and b are swapped to their correct position, which decreased the length of the cycle by one.
3.both a and b are not swapped to their correct position. This will split the cycle into two subcycles.
Solutions of D and F ??
True way of patriotism: study hard, solve as many problems as possible, win gold medal in ICPC for the country or because a excellent engineer to make contribution.
False way of patriotism: spread irrelevant words with irrelevant language in irrelevant platform.
ok
Oh, come on~ Contributions to the world, math world especially, seldom came out of patriarchy.
For those strange behavior in this post, I think expressing patriotism in word is their way to survive the culture around them, nothing about True or False.
History is stories about people in the past, I can't care less. Nowadays, wording is nothing, only power talks. let's just ignore them, and do what we think worth to our lives~!
Do notice that for a certain demographic of a certain age, copying and pasting slogans is the cheapest and most effective way to indulge in a fantasy of being a national hero.
the G is hard,isn't it?
Codeforces is not a place to discuss Nanjing Massacre or other political topics.
Sending information about Nanjing Massacre here can't help people not in China to know about it.
It's not their fault that foreigners dislike Chinese people.
Ban those fucking AI cheaters. I can bet that at least 1/3 of G solves are AI generated code. After the contest I pasted G statement to ChatGPT, and after less than half a minute it generates a acceptable code. Without advanced math knowledge, one almost cannot solve the problem. AI cheaters are stealing legit users' ratings.
What, at least 1/3 of the solutions to G problems are code generated by AI?
AI Beat Contest
Not that few people.
Why the editorial is not translate in English ?
Why are there so many sh*t comments from extreme nationalists under this post?
farming social credit like farming contribution
When will atcoder launch a rule that bans people to copy the code of the solutions of the original problems
I enjoy traveling to Hiroshima and Nagasaki; I'm NB!