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 26.10.2025 12:45 (Московское время). 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








Well, I didn't do much coordination, but still, I can assure you that the problems are great and you will enjoy the round.
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
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!
As a participant, hoping for quality problems
Me too!
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.