Автор BledDest, история, 3 года назад, перевод, По-русски

Привет, Codeforces!

В 18.12.2023 17:35 (Московское время) состоится Educational Codeforces Round 160 (Rated for Div. 2).

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 6 или 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Адилбек adedalic Далабаев, Михаил awoo Пикляев, Максим Neon Мещеряков, Роман Roms Глазов, Артем Ferume Иликаев и Руслан AcidWrongGod Капралов. Также большое спасибо Михаилу MikeMirzayanov Мирзаянову за системы Polygon и Codeforces.

Набор задач частично пересекается с Открытой Олимпиадой КФУ, поэтому если вы участвовали в ней — пожалуйста, воздержитесь от участия в раунде.

Удачи в раунде! Успешных решений!

Также от наших друзей и партнёров из Harbour.Space есть сообщение для вас:

Harbour.Space
WORK & STUDY OPPORTUNITY IN BARCELONA @ HARBOUR.SPACE UNIVERSITY

Harbour.Space University в партнерстве с Giga (Unicef) предлагают стипендию для получения степени магистра в сфере Data Science, Computer Science и Front-end Development, а так же опыт работы.

Мы ищем различных кандидатов от junior до mid уровня:

Специалист по работе с данными

  • Хорошие знания в области машинного обучения
  • Опыт работы с инструментами визуализации данных, такими как matplotlib, ggplot, d3.js., Tableau, которые помогают визуально кодировать данные
  • Отличные коммуникативные навыки – невероятно важно описывать результаты технической и нетехнической аудитории
  • Сильный опыт разработки программного обеспечения
  • Практический опыт работы с инструментами обработки данных
  • Способность решать проблемы
  • Аналитический ум и отличное деловое чутье
  • Высшее образование в области компьютерных наук, инженерии или смежной области приветствуется

Аналитик данных:

  • Подготовка данных
  • Анализ и изучение данных
  • Знание статистики
  • Анализ и визуализация данных
  • Отчеты и панели индикаторов
  • Общение и переписка
  • Знание предметной области
  • Ориентированность на решение

Front-end разработчик:

  • Уверенное понимание HTML, CSS и JavaScript
  • Знакомство с фронтэнд фреймворками и инструментами, такими как React или Vue.js.
  • Навык решения задач, внимание к деталям и страсть к созданию интуитивно понятных пользовательских интерфейсов имеют важное значение

Full-stack разработчик:

  • Интерес и опыт в разработке веб-приложений, информационных продуктов и OpenAPI
  • Умение работать с облачными службами развертывания (предпочтительно Azure), конвейером Git и CI/CD, а также процессами развертывания.
  • Приветствуется опыт работы с проектами с открытым исходным кодом
  • Уверенное знание ML
  • Опыт работы с инструментами визуализации данных, такими как matplotlib, ggplot, d3.js, Tableau
  • Отличные коммуникативные навыки — важно описывать результаты для технической и нетехнической аудитории
  • Большой опыт разработки программного обеспечения
  • Практический опыт работы с инструментами обработки данных
  • Способность решать задачи
  • Аналитический склад ума и отличное деловое чутье
  • Степень в области компьютерных наук, инженерии или смежной области приветствуется

Все успешные кандидаты будут иметь право на получение стипендии со стопроцентной оплатой обучения (29 900 евро в год), предоставляемой нашими партнерами.

ОБЯЗАТЕЛЬСТВА КАНДИДАТА

Обучение: 3 часа в день

За год обучения вы завершите 15 модулей (длительность каждого 3 недели). Ежедневная учебная нагрузка составляет 3 часа, плюс домашнее задание, которое нужно выполнить в свободное время.

Работа: 4 часа в день

Погрузитесь в профессиональный мир во время обучения. Вы будете учиться у лучших и с первого дня сможете применять свои новые знания на практике.

ТРЕБОВАНИЯ

  • Опыт работы в отрасли
  • Международный опыт
  • Стремление к обучению
  • Устойчивое развитие ключевой момент для вас
  • Желание работать на общественную организацию
Подать заявку →

UPD: Разбор опубликован.

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится -68 Проголосовать: не нравится

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

i wish, i can solved the C no problem in this round ...!

»
3 года назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

Hope the questions are not confusing.

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

I'm back with one more post-contest discussion stream
I will discuss the problems I solve in this contest.

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

Educational rounds are always exciting, don't know what they surprise.

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

hope i get positive delta :D

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

For some reason I didn't get the notification that the round would be unrated for me (rating must be between 0 and 2,099), and there is no unrated marking on the registrants list. Is this intended (or am I misremembering)?

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

Sometimes the educational rounds being hard for me But I feel this one will be interesting ☺️

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

Hope to become specialist this round!!!

»
3 года назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

Is it rated?

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

Hoping to perform better than my previous contest.

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

What's the difference bwtween normal rounds and educational rounds? It really bothers me.

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

USACO bronze annually is clashing with this contest :(

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

let's make it Cyannnnnn

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

Hope to become an expert after this round.

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

Speedforces

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

C <<<< D

i think there is huge gap between them

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I couldn't able to come up with an solution for this problem tried using bit manipulation but got wa on testcase 3 do we have to solve this using any other approach.

    • »
      »
      »
      3 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      you mean problem C?

      • »
        »
        »
        »
        3 года назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится

        yes

        • »
          »
          »
          »
          »
          3 года назад, скрыть # ^ |
           
          Проголосовать: нравится 0 Проголосовать: не нравится

          My solution for problem C

          To count how many we have for each power use vector or just ordinary array with 30 elements for each power of 2 that could be entered (0 to 29).

          For the first type of operation, just increment that value in the vector.

          For the second type of operation, go through from 29 to 0 and subtract until the values are finished(refer to the first vector for how many you have with that power of two) or v which was input has less value than the power of 2 we want to subtract. At the end, check if v is 0 or not, if it is answer is "YES", otherwise it is "NO"

          You can refer to my submission here: 237768705

          • »
            »
            »
            »
            »
            »
            3 года назад, скрыть # ^ |
             
            Проголосовать: нравится 0 Проголосовать: не нравится

            Great approach,thanks for sharing your approach. according to you what will be the rating of this problem

          • »
            »
            »
            »
            »
            »
            3 года назад, скрыть # ^ |
             
            Проголосовать: нравится +1 Проголосовать: не нравится

            Another approach....

            while (n--)
                {
                    ll a, b;
                    cin >> a >> b;
                    if (a == 1)
                    {
                        v[b]++;
                    }
                    else
                    {
             
                        vector<ll> tm = v;
                        ll carry = 0;
                        bool flag = true;
                        for (ll i = 0; i < 30; i++)
                        {
                            tm[i] += carry;
                            if ((b & (1ll << i)))
                            {
                                if(tm[i] == 0)
                                {
                                    ctn;
                                    flag = false;
                                    break;
                                }
                                tm[i]--;
                            }
                            carry = (tm[i] / (ll)2);
                        }
                       if(flag) cty;
                    }
                }
            

            So to calculate we can get w from out list or not , i just started traversing each bit of w , if at ith bit is 1 in w then we will look that we have ith bit or not in hashmap.If No then we print NO , If yes then decreament ith bit from our hashmap. if there is still some remain in ith bit then we can push it ahead , like we have m[2] = 3 and we have used it one from it so now we had 2 that is (2^2 + 2^2) we can write this as 2^3 so we can increament m[3] by 1. so in genral we have count extra for ith bit then we can increament m[i+1] by floor(count/2.0).

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -16 Проголосовать: не нравится
»
3 года назад, скрыть # |
 
Проголосовать: нравится +40 Проголосовать: не нравится
After doing ABC
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to do E?

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Using Flows

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

    I guess, Flows with Demands should satisfy the problem. Just throwing in some virtual nodes for outflow from each node and inflow to each node should do the job. Here, a node is a row/column, and edges are delta-based flows on flipping cells. Note that we know the original sum across rows/columns, and only care about needed deltas through flipping. This delta determines the demands on inflow/outflow virtual nodes.

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

      Agree. I'm about the same.

      Use minimum cost maximum flow. Specifically, create a node x[i] for each row i and a node y[j] for each column j.

      For each cell in the i-th row and j-th column, create an edge (x[i], y[j]) with a flow of 1. Flow represents filling the cell with 1. If the cell originally contains 1, calculate the cost in advance with a unit cost of -1 to offset the premature calculation cost. If the cell originally contains 0, the unit cost is 1.

      Connect the source node to x[i] with an edge of flow a[i] and cost 0. Connect y[j] to the sink node with an edge of flow b[i] and cost 0. If you understand that flow is “1”, this step will be quite natural.

      Finally, run the maximum flow algorithm. If the flow is equal to sum(a[i]) = sum(b[i]), it indicates that the assignment is valid, and the answer is the minimum cost; otherwise, it is invalid.

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

is rating change delta which shows during contest accurate?

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

How to solve E? Is it related to graphs somehow?

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится +20 Проголосовать: не нравится

    Make a flow network with n+m+2 edges. One is sink, one is source and n vertices for rows and m for columns. Make edges with capacity r[i] to all rows from source and edges of capacity c[j] and cost 0 from columns to sink. Also make edges from row i to column j with capacity 1 and cost 1-a[i][j]. Your answer is minimum cost max flow plus the number of a[i][j] == 1 where the i -> j edge was not taken.

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

E reduces to this CSES problem: Grid Puzzle II

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

I couldn't able to come up with an solution for C problem tried using bit manipulation but got wa on testcase 3 do we have to solve this using any other approach.

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

Speedforces for someone

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

Unbalanced Contest,

A,B,C were too easy and D is too hard.

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

Wrong answer on test 24 in E — Matrix Problem ,, can any one give a test case sorry for my bad English

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

D is somewhat monotonic stack and dp, I thought so

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

.

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

D fucking boggled my mind. I thought I had it like, 3 or 4 times, only to fail sample, find out that my method is wrong, come up with new method, rinse and repeat. I wrote everything from monotonic stack to segtree today 🤡

»
3 года назад, скрыть # |
 
Проголосовать: нравится -13 Проголосовать: не нравится

knew D was div-conquer with min but couldn't implement 😭

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

How to solve D?

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

What's the idea behind D

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится +9 Проголосовать: не нравится

    DP on suffixes, maintained with a monotonic stack.

    Compute for each index how many arrays you can reach that start with it, ignoring elements before it. You can delete any prefix starting from it that contains no smaller values (the monotonic stack is for this) or delete a prefix immediately after it to reach smaller elements further away. I handled this part with a set but upon further inspection it’s really just a copy of my stack ;)

    • »
      »
      »
      3 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Could you explain the part "or delete a prefix immediately after it to reach smaller elements further away", it's a bit ambiguous for me.

      • »
        »
        »
        »
        3 года назад, скрыть # ^ |
         
        Проголосовать: нравится +9 Проголосовать: не нравится

        The first case, where we delete until some index before the next smaller value, does not cover cases where the element immediately after the first one is smaller than it. Consider for example the following case:

        4 3 2 1

        The array 4 2 1 can be obtained by operating on [2, 3], but since 2 comes after the next smaller value after 4, we would not have counted this case. Arrays where the second element is smaller than the first will be obtained by operating on [2, j], if we want the j-th element (smaller than the first) to become the second. And it's only possible if a_j = min(a_2, ..., a_j). So we maintain the set of possible indices j, and remove elements from the set over time.

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

    The problem is quite similar to Indonesian NOI contest here

    I think the approach should be quite similar. Assume $$$dp_i$$$ is the number of ways that the array ends with $$$p_i$$$, then we can consider that for a range $$$(l, r)$$$ we can calculate number of ways when $$$p_l$$$ or $$$p_r$$$ is the minimum

    For each $$$r$$$, there are two possibilities :

    • find conditions for all values $$$l \lt r$$$ where $$$p_l$$$ is the minimum from $$$(l, r)$$$ then $$$dp_l$$$ is a contributing factor to $$$dp_r$$$

    • find conditions for all values $$$l \lt r$$$ where $$$p_r$$$ is the minimum from $$$(l, r)$$$. To do this, find an index $$$i$$$ such that $$$i$$$ is the previous smaller element of $$$r$$$. Then $$$dp_{i+1}, dp_{i+2}, ..., dp_{r-1}$$$ are contributing factor of $$$dp_r$$$

    For the first case, we can maintain a monotonic stack and maintain the sum of all dp within the stack

    For the second case, we can use a monotonic stack to maintain previous smaller elements for each index and to find the sum of the dp we can use a prefix sum of dp

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    you can do it with DnC on the minimums of the array, split the array on the minima and calculate recursively for the left and the right part and merge those results

    • »
      »
      »
      3 года назад, скрыть # ^ |
       
      Проголосовать: нравится +5 Проголосовать: не нравится

      Can you explain your approach, what would be the base case and the merging condition?

      • »
        »
        »
        »
        3 года назад, скрыть # ^ |
        Rev. 3  
        Проголосовать: нравится +80 Проголосовать: не нравится
        • Solve the problem for the whole array $$$[1, n]$$$. Let $$$m$$$ the position of the minimum. Note that you cannot delete the minimum, and the moves on the left and on the right are independent. So the answer is the product of the answers on $$$[1, m-1]$$$ and $$$[m+1, n]$$$.
        • How to solve for a generic interval $$$[l, r]$$$? Note that you can either keep $$$m$$$ (the position of the minimum value in $$$[l, r]$$$) "alive", or use the elements in positions $$$l-1$$$ and $$$r+1$$$ (if they exist) to delete $$$m$$$.
        • Let $$$a$$$, $$$b$$$ be the answers in the intervals $$$[l, m-1]$$$ and $$$[m+1, r]$$$. In any case, we can keep $$$m$$$ "alive" (in $$$ab$$$ ways). If $$$l \neq 1$$$, we can delete $$$m$$$ (actually, all elements in $$$[l, m]$$$) in $$$b$$$ ways. If $$$r \neq n$$$, we can delete $$$m$$$ (actually, all elements in $$$[m, r]$$$) in $$$a$$$ ways. If both $$$l \neq 1$$$ and $$$r \neq n$$$, we are overcounting the case where we remove every element in $$$[l, r]$$$, so we must subtract $$$1$$$ back.
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

another speedforces round!

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

I think Problem D is same as this, Except the constraints are tighter.

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

Speedforces lol

»
3 года назад, скрыть # |
 
Проголосовать: нравится -77 Проголосовать: не нравится

Easiest D ever seen

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

How to solve E?

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

any hints for D? also can someone try to hack my C?

about c
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why C failed at test case 5?237765289 Could anyone point out what i missed ?

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

speedforces moment

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

Today is my birthday, and I wrote this round.lol

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

I think problem F is quite similar to this problem.

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

I don't understand why there is such a large gap in difficulty between C and D.

»
3 года назад, скрыть # |
 
Проголосовать: нравится -15 Проголосовать: не нравится

if i had an hour more, i can definitely solve D.knew it was some dp and related with monostack stuff.nice problem anyway

»
3 года назад, скрыть # |
 
Проголосовать: нравится -79 Проголосовать: не нравится

F has appeared before: coi15p2. And no, it wasn't like the idea coincided or something, this is the exact same problem. I mean, problem-setters could just avoided this by literally search their problem up, but they didn't, which I don't really get.

As a result, an unusual number of consistently low-rated contestants AC F, which are solved by like, what, 30 people, LGM included. A person whose skill are around Expert — Candidate Master level should not be able to pull that off in a 2 hours contest.

If enough people complain about this, the contest could probably get unrated, or... since F is solved by so few people, and these guys solved so few problems that it shouldn't matter. I don't know. Personally, I want the contest to get unrated to punish these MF

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

Very interesting contest, for me problem " C " was super easy even easier than " B " as I love math problems , Thanks for authors <3

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Could you share ur intuition for C? C got a lot of ACs . Everybody figured it out so quickly except me

    • »
      »
      »
      3 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Sure, we know that pow(2,n) it's binary representation is 100.. ( 1 followed by zeroes )

      now for any number X it's binary representation is ones and zeroes for example " 1011 "

      we can write it as 1000 + 10 + 1 which all of them are in the form of pow(2,n) .. So, if we subtract the maximum pow(2,n) less that X form X we will reach to X = 0.

      in this problem we just add one condition that pow(2,n) must be inserted, also we subtract this number from x until it's frequency in the vector or until X become less that it

      // operation 2
      // cnt is temporary freq
      // ar is the freq
      vector<int>cnt = ar;
      cin >> t;
      for(int i = log2(t); i >= 0; --i)
      {
         int mx = pow(2,i);
         if( mx <= t && t && cnt[i])
         {
             // t = constant(k)*mx
             // k musn't exeed cnt[i]
             int k = min(cnt[i],t/mx);
             cnt[i]-=k;
             t -= k*mx;
         }
      }
      

      Wish you got it

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

That problem D was just so hard!!!

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

Can someone please hack my C? It's O(n^2) in some cases and I think it should TLE. But I tried the case of 50000 1 0 queries followed by 50000 2 50000 queries and it didn't TLE.

UPD: I resubmit it to judge it on the new test cases and it passes in 1013 ms. So I may have gotten away with it this time. I'll take it as a learning experience.

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

why this get so much downvotes?? just for D was too hard?

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

Folks, why in the problem C the greedy approach for the queries of type 2 works? For example, in the normal coin change problem the greedy approach won't work afaik, why here it works? Thank you guys, appreciate!

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

can anyone say why greedy 0-1 knapsack working for problem C, 0-1 greedy knapsack don't work for all denominations right. did there is any special properties of 2 powers that is making greedy knapsack work?if yes what is that prroperty

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

Uh how does rating work? Will I get rating for this round regardless of my score? Someone explain pls

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Yes, you always get a new rating for all contests that are rated for you. This contest is rated for anyone under 2100. Considering that you're currently unrated (that's 0 basically), it IS rated for you.

    Rating works as follows — for any rated contest that you give, your rating is updated based on your performance. If you perform well, it increases, else, it decreases. Anyway, rating is just one factor to competing, in the long run, the experience results in a net positive anyhow. Have fun! :)

    • »
      »
      »
      3 года назад, скрыть # ^ |
       
      Проголосовать: нравится +6 Проголосовать: не нравится

      Ayo thanks for the reply. Okay so this is a pretty cool system. I did very badly, but eh it's just for fun. It's actually kinda refreshing to compete in programming just for the heck of it.

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

Can anyone suggest me a more optimal solution for C? My Submission

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

Problem C was much easier than i thought TT

solve()
»
3 года назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится
  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +3 Проголосовать: не нравится

    good one !

    can you explain your approach how the index of element is helping you to construct the ans

    as you stored (element,index) in root , what is the contribution of left ans and right ans

    correct me if Iam wrong

    even I thought of the contribution of minimum index but couldn't proceed:D

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

      for each segment l..r i am getting min value and it's index, let it be (mI). then making a call to its left and right excluding the index. left = l..(mI-1) right = (mI+1)..r

      now, there can be two cases, case 1: when we include element with index mI in our required final array: if that is the case answer is simply leftAns*rightAns.

      case 2: when we don't include element with index mI, this case is difficult in my implementation:

      in this case we have to know whether is there a smaller element than mI on left side and/or right side. thus bools isL and isR

      if isL, then we have to remove all left side including mI, then ans will be added is right side. similarly, left side might be added. note: left side and right side includes empty array also, then there can be case where both isL and isR, then empty would be added twice thus remove isL&isR.

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Nice One!

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

Speedforces

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

Plese explain D

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

Can anyone understand the code for problem D of tourist? I can't understand what dp_nxt and dp_sub mean.

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

Honey, I love you too.

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

How to solve Problem C using bitset.

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

Won't we get solutions?

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

Is there a reliable rating predictor available as of today? This one doesn't seem to be working accurately any more.

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

https://codeforces.me/contest/1913/submission/237789418

https://codeforces.me/contest/1913/submission/237900686 The same!!! The first one was hacked The second one was accepted؟؟؟؟؟

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

Hello.Why ratings hasn't come yet?

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

how to solve D ????

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

What about the editorials and rating changes?

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

Can anyone tell when will the rating of this contest release. It's already more than 21hrs...hoping soon.

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

did they forget to update the ratings? Div 3 contest will start soon. How will the ratings be given if they dont update it today lmao.

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

When will this contest rating update and where is the editorial

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

Problem C was terrible for its place.

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

Please add the editorials.

»
3 года назад, скрыть # |
Rev. 4  
Проголосовать: нравится +3 Проголосовать: не нравится

Since no tutorials have been provided yet (as well as my rating change), here are my short hints of problems D, E, F.

Hint of problem D
Hint of problem E
Hint of problem F
»
3 года назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

When will the rating of this round be updated? I was hoping to become specialist and then give today's div3 as a rated round.

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

40 min left for next contest to begin and no change in ratings so far. Uneasy situation.

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

Problem C

Hey can anyone tell the error in this solution 237781165. I am getting runtime error.

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

    I managed to pin point the issue.

    You can see these two submissions:

    238078175 Accepted

    238078130 Runtime error on test 3

    The only difference is that the loop variable i being int or long long

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

    I think I figure this out.

    The issue of your code is that, when you vector v has no element, i.e. for type 2 query, b is 0, v.size() is 0 and v.size() - 1 should be -1.

    However, v.size() actually returns unsigned integer, so v.size() - 1 becomes really big (underflow) and it pass the for loop condition i >= 0. Then accessing v[i] will cause a segmentaion fault.

    I am not sure why this doesn't happen to test1 and test2 though,

    To solve this bug, you can simply push back a 0 to the vector v to make sure that underflow never happened. See 238078855 for added lines.

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

Why are the ratings not out yet?

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

Is the contest unrated?

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -11 Проголосовать: не нравится

Attention!

I received the following message from system: Your solution 237799004 for the problem 1913B significantly coincides with solutions mayank246/237799004, Naytive_Ritninja/237800400. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.me/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

As that was the approach used by most of the candidates and the candidate is unknown to me. It's just a matter of coincidence that my code matches with other person. Kindly review it. and give me my rating back. BledDest

»
3 года назад, скрыть # |
Rev. 11  
Проголосовать: нравится +38 Проголосовать: не нравится

Wait what.

I thought it was rated for Div.2