Salam Codeforces!
Team A² is glad to invite you all to the second contest in the STEM Avengers series of contests, STEM Avengers: Age of Algorithms, which will start on Oct/26/2025 12:45 (Moscow time). You will be given 7 Problems and 2 hours to solve them.
All the problems are written and prepared by me (Abdur-Rehman), M_AsadHussain, and JonKhan.
This contest is going to be an Avengers themed contest, with the problems being named and themed after Avengers Phase II movies. Now that the STEM Avengers have assembled, let's get to algorithmic fights!
The round will be rated in the A² rating system and will be held on extended ICPC rules. After the contest, your code will be tested manually (and may get hacked or skipped). The difficulty would be comparable to Div. 3/4. The problems will be partially sorted by difficulty. The problems include a wide variety of topics — from Combinatorics and Greedy Arrays to Number Theory and Graph Theory!
Join Our Group
Contest Gym
We would like to give our sincere thanks to:
AbdullahIshfaq for his amazing coordination and problem proposal.
Hayan for his coordination (telling us to talk to AbdullahIshfaq) and testing.
MikeMirzayanov and KAN for making and maintaining the wonderful codeforces and polygon platforms.
You for participating in our contest.
What we imagine our participants might look like.
UPD 1:
Final Standings are out, Click Here to view them.
Congratulations to the winners








After the contest, your code will be tested manually (and may get hacked or skipped)so you're going to manually check every submission and validate each of them by hand?Not really, only solutions with suspicious levels of similarity or way higher runtime or memory usage than expected would be judged manually.
We have a Moss-like Plagiarism Detector System for checking similarity!
Sounds cool!, newbies making a contest wich is being tested by a master and specialist.
As an author, I hope you participate.
WHAT IF HE DOESNT???????????????????
I said in general to everyone not only him.
Where is the invitation for the gym ?
Extremely sorry for the inconvenience, Click Here for the gym link. By the way you should also join our group, the link is given in the blog.
Sure,thanks
Well, I didn't do much coordination, but still, I can assure you that the problems are great and you will enjoy the round.
😉
this is so tuff dreadolisk.
thx
Seems cool waiting for it but have one question
The round will be rated in the A² rating systemCould someone explain a bit more about how this works?See our website Team A²
Okay
spread this thing everywhere https://docs.google.com/forms/d/e/1FAIpQLSdWbnkv4i4gaBImii3OKjR7UzclVJzTgNyfcWhl1qF5dOubFA/viewform
As an author, I must say — the problems are truly amazing!
The only author that has been a green coder in the past...
" the problems are truly amazing!" Sounds good
Nahh! I'd win!
What we imagine our participants might look like.
What will they look like: 
Hopefully Not...... hopefully.....
As a participant hope that the problem are interesting!
brother you are an author...
Shouldn't registering the contest be available a few days before the contest, NOT the same time as the contest?
It will be automatically registered!
Yep!
As a participant, hoping for quality problems
Me too!
We can assure you that the problems will be high quality!
Good to know!
As a participant, hope that problems will be fantastic!
Hope, everyone loves the contest.
The Contest is about to begin!
5 mins remain
Was a nice contest! Thank you for making it!
++ Good Div3/Div4 problems
+ Active Moderators that responded quickly and fixed problems live
- Some problem (statement) related problems
If I won't forget about the STEM Avengers series of contests I will participate in the next one too.
(I hope there will be an editorial)
Thanks a lot! We have a lot learn and will surely spend more time on the highlighted issues and will spend more time on ensuring the statement quality and other aspects of the problems that we got wrong (and we will make the next problem F better lol).
Well problem 'F' made by one and not only M_AsadHussain was kind of a bummer with wrong backend solution, + wrong sample input otherwise it was a fun contest with fun G and kind of fun E
Sorry for the mistake, but it was good to hear from you that you enjoyed the contest.
Congratulations to PaPaPiZzA, we once again apologize for the inconveniences caused by us.
Please upload solutions (either commented, or just the problem setters' or problem testers' codes). At least for the next contest.
Please give some hints for problem G: Resonance of Corrupted Circuits
Actually that problem was given by e and I am the only one who knows the solution so tell me how much have you done!
Usually, in these types of questions, sieve is applied. I can't think further.
You will need to apply a small amount of graph theory too let me know what do you think now!
Give some more hint please.
Try to find cycles, use sieve and find gcd.
For problem G, I have implemented my solution.
My submission: 354518484
But, getting wrong answer on test 2.
Can you please share test 2, for debugging. Tests other than test 1 are not visible (even partially).
My solution:
For each prime xi, I have a auxiliary graph, where both endpoints of the edges are divisible by xi.
Then, in that auxiliary graph, for each SCC, find the GCD of all nodes in that SCC. If the GCD of any SCC == asked GCD, then, yes, there exists a cycle, otherwise no.
My Solution is to iterate through the graph and check if cycle formed the check if its a prime using sieve and then put it inside a map then check in log(m) time that if desired GCD is in the map.
In 642756F - Stabilizing the Overloaded Stones, in example testcase 3, k = 3, we can't convert 67 into 17. Why is the answer $$$1$$$ for 3rd index
that problem was made by M_AsadHussain if you message him I'm sure he'd be more than glad to help you out with your queries.
In the third test case you can keep subtracting 3 from 67, then it becomes 1, then subtract 3 again and it will become 2 due to it being absolute value, Then add 3 five times and you get 17.
Thankyou, doubt resolved. It says, you can make x = |x — k|. I was missing the absolute word.