This Friday (25th Mar, 2022) at 9am GMT+7, the 2021 ICPC Vietnam Regional Contest Mirror contest will take place. The link to the contest is: https://oj.vnoi.info/contest/icpc21_regional_m. The official on-site contest will start one hour earlier.
This is the first time the contest is hosted on a Vietnamese-built platform, Vietnam Online Judge. The system will require an account to join the contest, but it should be pretty straight-forward to do so (Please select the English language when you first enter the site).
On behalf of the organiser, we hope you will like the problem set as much as the effort we have put in to create it!
Update: You just need to create an account & wait for the contest to start & compete. No registration is needed. Also, there is currently no team system yet, so you can consider sharing the account for your entire team.
Auto comment: topic has been updated by Lomk (previous revision, new revision, compare).
Auto comment: topic has been updated by Lomk (previous revision, new revision, compare).
Another judge supporting C++20 :O
It has started.
Problem I in the mirror is not setup correctly, so it's not solvable there (though it's ok in real contest). zhangguangxuan99's solution is correct, sorry about that.
All submissions of the problem I in the mirror contest have been rejudged. The scoreboard has been updated + unfreeze as well.
Link to the scoreboard
Where will i found the editorial? What was the approach for problem M? MillionPlex Problem
The main point is the equality $$$(A + B)^2 = A^2 + 2AB + B^2$$$. That means if we know the sum of $$$A^2$$$ and the sum of $$$A$$$, then we can find out the sum of $$$(A+B)^2$$$ with ease.
We will maintain 3 things, $$$cnt$$$, $$$sum$$$, and $$$sum2$$$, which are, respectively, how many characters we have considered, sum of all substrings, and sum of square of all substrings ($$$cnt$$$ is literally the iterator variable, but is just listed here for the sake of completeness). Initially all of them are $$$0$$$. Go through each character of the string from left to right, update these three info correctly as you go.
Do ask if you need other problems.