Блог пользователя Lomk

Автор Lomk, история, 2 года назад, По-английски

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.

  • Проголосовать: нравится
  • +83
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by Lomk (previous revision, new revision, compare).

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by Lomk (previous revision, new revision, compare).

»
2 года назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

Another judge supporting C++20 :O

»
2 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

It has started.

»
2 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

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.

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Where will i found the editorial? What was the approach for problem M? MillionPlex Problem

  • »
    »
    2 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +13 Проголосовать: не нравится

    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.