Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×
Автор awoo, история, 3 года назад, По-русски

Привет, Codeforces!

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

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

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

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

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

Отдельное спасибо тестеру раунда stAngel за ценные советы и предложения!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ТРЕБОВАНИЯ

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

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

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

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

In blog : The problems were invented and prepared by ..., Roman Roms Glazov, ...
But in contests page Roms doesn't exist.

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

I'm always scared of educational rounds because I tend to do worse in them — but it's never too late to turn the trend around. Good luck everyone!

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

Thanks HARBOUR.SPACE UNIVERSITY

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

Hi all, it would help if you can post some insights/hints for the problems of this contest (AFTER it ends) on https://starlightps.org. Here is the collection for the problems of this contest: https://starlightps.org/problems/collection/cf-edu-154/.

This will help us get more data so users can have a platform to:

  • share/discover hints/insights on various problems
  • find similar problems given insights they struggled with.

Check it out if you're interested. Thanks!

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

Get ready for the worst implementation problems like always

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

hope this round can reach 1200

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

I'm unrated. Can I participate? I've never participated in any contest before. This is my first time in codeforces. :')

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

This is the last contest before the National Day holiday in my country.

I will do my best!

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

Wish no weak pretests again.

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

Hopes to get educated from this educational round

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

Hoping to get more educated in this educational round

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

Good luck!

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

It seems that the standings is broken unusual currently (it shows all participants in official standings, even div.1). Could you please fix redesign this bug unusual design ASAP?

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

Will be delta calculated considering contestants from div. 1 or not?

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

Can anyone help and tell for which test case my solution is failing? Problem : C Submission link

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

C>>D.

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

adhoc forces

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

    I solved B, D and E using DP :)

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

      What was your states and transitions to solve E ?

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

        dp[i][j]: number of arrays of size i such that the last j elements are distinct

        if j = k then the last j elements form a permutation and if j>k it means the last j%k elements are distinct and there are j/k permutations not including the last j elements

        dp[0][0] = 1

        for transitions:

        dp[i][j] = (summation dp[i-1][l] where l>=j and floor(l/k)=floor(j/k), and l is not a multiple of k) + dp[i-1][j-1]*(k-j%k)

        k-j%k is the number of possible elements distinct from the last j%k, it's the number of possible ways to make the last j%k+1 elements distinct

        the number of possible ways to make only the last j%k — x numbers distinct is 1, just append the xth element from the end

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

How to solve E?

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

How to solve D? do we need to consider some increasing and decreasing slopes?

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

    You can make some prefix negative and rest all positive.

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

      Can you tell me how you came up with this intuition? A lot of people found this fairly easy but I couldn't come up with any solution.

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

        First, assume we are only dealing with positive numbers. For any adjacent a,b, if a>=b, we will have to multiply b and all numbers after it Proof assume there is a c after b. If b is already less than c, multiplying both is the surest way to preserve that. If b>=c, then (again, with positive numbers) no matter what we do we can't change that, so it's still fine to multiply both.

        Now we can extend this to negative numbers using similar logic (replace a<=b with a>=b). Since we need a strictly increasing sequence, we can do a single transition from negative to positive numbers, but it may not be necessary (all negative/all positive could be better).

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

3 contests in a row solving E but can't finish in time, fuck

smb please tell their solution to E?

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

    Same to me for problem C. Long way to go on the revenge journey.

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

    I solved by finding, "in how many arrays does some subarray contribute?"

    For this, I use a dp state where dp[i] gives number of arrays of length i, such that the subarray ending at the last index is used.

    Now for calculating dp[i], we can first see that elements from i-k+1 to i should form a permutation of k, and for the rest, we can give any element from 1 to k. So we initially set dp[i] to be k! * exp(k,i-k).

    Now we need to subtract those arrays from dp[i] which have their last used subarray ending at some index in the range [i-k+1, i), because it will intersect with our subarray ending at i. Suppose we have an array ending at j, which lies in [i-k+1, i). So number of arrays such that last used index is j, and [i-k+1,i] still forms a permutation is dp[j] * (i-j)!. We subtract this value from dp[i] for all j in [i-k+1, i).

    Now our answer is the sum of contributions of all subarrays, so we can simply sum up dp[i] * exp(k,n-i), because for all elements after i, we can place anything we want.

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

Took so much time for C, couldn't even think about D much. How to solve D?

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

    Divide the array into two halves, make first half negative ascending and second half positive ascending. Pick the best answer among all possible half partitions (you can also make all positive and all negative).

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

    If you only multiply by positive number then the answer would be number of elementsi such that a[i]>=a[i+1]. Instead what we can do is for some i turn the prefix before it to a negative increasing array. If the prefix contains k strictly decreasing segments then the number of operations needed to convert the whole prefix to an strictly increasing prefix such that all it's elements are negative is k. So we can just check it for each index i and calculate the minimum

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

How to solve Problem D? I couldn't solve it, got a headache from Problem C :(

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

I feel D<C and the implementation of C was complex. What's the easiest solution for C?

my submission: 221301419

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

How to solve C?

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

How to solve C?

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

    If a prefix of an array is not sorted, the arrays to which the prefix belongs is also not sorted. If array is sorted, all its prefixes are also sorted. Just simulate operations from left to right and keep track of the state of the prefix (whether it's sorted, not sorted, or no idea), if you find a contradiction, answer is no otherwise yes.

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

C is so bad

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

C is so bad

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

Huge increase in difficulty from D to E. Why is it that only GM or LGM-s can solve last problem on div 2? It's rated under 2100 but not expected to be solved someone under 2100.

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

C was a brilliant problem.Took me an hour to realise it could be solved by set and lower bound.

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

A: One of "13" and "31" will be a subsequence of permutation of [1, 9], and both of them are prime.

B: Note that during the operation, the occurence of substring "01" can only be removed but can't be created. Since the first and last character can't be changed, there will be occurence of "01" in both a and b after operation, and they need to occur at the same position, so there must be some position that "01" occurs at this position both in a and b initially. On the other hand, if a[i]=b[i]='0' and a[i+1]=b[i+1]='1', we can do operation (1, i) and (i+1, n) both on a and b, then a and b will be the same.

C: We need to maintain 2 values: pos1 = the leftest possible position such that a[pos1-1]>a[pos1], pos2 = the maximum possible prefix such that a[1, pos2] is sorted. When we process query '0', we need to check if pos1<=length, then let pos2=length-1, and for '1' we need to check if pos2>=length, then let pos1=inf.

D: Suppose we need to make a[1, k] negative and a[k+1, n] positive. For making a[k+1, n] positive and sorted, we need a operation for each k+1<=i<n and a[i]>=a[i+1]. For making a[1, k] negative and sorted, we need a operation for each 1<=i<k and a[i]<=a[i+1], then we need an extra operation on [1, k] multiply by -1. Therefore we can solve the problem by keeping prefix and suffix sums.

E: When solving the problem for a single array, we can solve by greedy: Iterate i from 1 to n, when a[i-k+1, i] is a permutation and doesn't intersect with any subarray we've taken, we take it as a valid subarray. Let dp[i][j] = the answer when we consider arrays of length i and the length of the maximal suffix without duplicate elements is j, cnt[i][j] = number of arrays of length i and the length of the maximal suffix without duplicate elements is j. For 0<=j<k-1, the update is dp[i][t] += dp[i-1][j] for 1<=t<=j, dp[i][j+1] += (k-j)*dp[i-1][j] (similar for cnt[i][t]). When j==k-1, adding the missing number of the suffix with length k-1 will create a new permutation as a subarray, so the answer need to be increased: ans[i][0] += ans[i-1][k-1] + cnt[i-1][k-1], and for 1<=t<k, we have ans[i][t] += ans[i-1][k-1]. Thus we can solve the problem in O(n*k) by using prefix sum for range updates.

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

Best contest of my life, Thanks. UwU

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

This guy v6ishal is streaming contest live on youtube. Is there something that can be done? Link to the video : https://www.youtube.com/live/JLoIIk9S_F0?si=MASh06PY_pKUhj22 Channel Link : https://youtube.com/@v6ishal?si=uUk4r0I3VbBfbeI_

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

Am I the only one who thinks the sample testcases are too weak? T_T

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

    +1

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

    btw, I upsolved problem D using DP. I noticed that most contestants solve it with some observations. If anyone's approach is similar to mine(not a good "observer" haha) and is stuck in WA, I hope my submission will help!

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

      hard dp to understand, maybe you can explain what is f[i][j]?

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

        $$$f_i$$$ is the answer considering $$$[1,i]$$$.

        $$$f_{i,0}$$$ is the answer when we modify $$$a_i$$$ with a negative number, and $$$f_{i,1}$$$ is the positive case.

        Then the following process is kinda natural. If $$$a_i$$$ and $$$a_{i-1}$$$ can satisfy the restriction in one operation, the answer is equal(just "extend" the operation from $$$i-1$$$ to $$$i$$$), otherwise it has to $$$+1$$$.

        • $$$a_i \gt a_{i-1}$$$
        • $$$f_{i,1}$$$: whether $$$a_{i-1}$$$ is modified positive / negative, $$$a_i$$$ can be greater than it without another operation("extend" the operation / just do nothing), so $$$f_{i, 1}=\min(f_{i-1,0}, f_{i-1,1})$$$.
        • $$$f_{i,0}$$$: if $$$a_{i-1}$$$ is positive, it doesn't make any sense for $$$a_i$$$ to be negative, and we don't consider that. If we extend the negative operation on $$$a_{i-1}$$$ to $$$a_i$$$, $$$a_i$$$ will become smaller. So one more operation is required. $$$f_{i, 0}=f_{i-1,0}+1$$$.
        • $$$a_i \lt a_{i-1}$$$
        • $$$f_{i,1}$$$: if we extend a positive operation on $$$a_{i-1}$$$ to $$$a_i$$$, $$$a_i$$$ is still smaller, so one more operation is required. if $$$a_{i-1}$$$ has become negative, we do nothing. $$$f_{i, 1}=\min(f_{i-1,0}, f_{i-1,1}+1)$$$
        • $$$f_{i,0}$$$: if we extend a negative operation on $$$a_{i-1}$$$ to $$$a_i$$$, $$$a_i$$$ will be greater than $$$a_{i-1}$$$ and we don't need to spend another operation, $$$f_{i, 0}=f_{i-1,0}$$$.
        • $$$a_i= a_{i-1}$$$ is a mix of the above.

        thus $$$\min(f_{n,0}, f_{n,1})$$$ is the final answer.

        ah, it looks the nested markdown list is broken...

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

Did anyone else solve B using dp because it seemed simpler than trying to find a greedy solution or is it just me?

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

It was the worst Educational round (in my opinion), thanks to BledDest, Neon, Roms, adedalic and awoo!

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

A was very tricky

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

.

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

this isn't an educational type round imo. just tricky constructive implementations

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

Since when does CF give penalty for failing on samples?

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

Does anyone have an example where doing a prefix sum instead of suffix sum for D doesn't work?

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

Is Someone tell me how to i solve A & B fast in div2 contest. To give me any advice. Thanks.

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

Help me explain problem C. test case: ++++0++---1. why the result is TRUE

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

    List of numbers inserted in order: 1,2,4,3,5,6.

    The first 4 elements are not sorted so the 0 and after inserting remaining 2 elements you remove the last 3 elements which leaves us with1,2,4 which is sorted so the 1.

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    1. arr = {1}
    2. arr = {1, 2}
    3. arr = {1, 2, 3}
    4. arr = {1, 2, 3, 2}
    5. arr = {1, 2, 3, 2} => 0
    6. arr = {1, 2, 3, 2, 3}
    7. arr = {1, 2, 3, 2, 3, 3}
    8. arr = {1, 2, 3, 2, 3}
    9. arr = {1, 2, 3, 2}
    10. arr = {1, 2, 3}
    11. arr = {1, 2, 3} => 1
  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    until the array size reach 4 you don't know weather it's sorted or not when the array size becomes 4 0 appears which means array is not sorted and it can be due to 4th element or any of the first 3 elements after that 2 elements added last 3 elements removed we are left with first elements and we don't know weather it's sorted or not so it can be sorted sorted and the sequence is correct for eg:- add 1, add 2, add 4, add 3 -> unsorted add 5, add 6, remove 6, remove 5, remove 3 array becomes 1, 2, 4 -> sorted

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

    for each + sign append the following number

    2,3,4,3

    after this it is 0 so the array formed is unsorted again for each + append following number

    2,3,4,3, 5,6

    now remove three number from last as we have — then we get 2,3,4 after this it is 1 and also the array is sorted so it is true.

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

Can anyone explain the observation of problem B as A[i] == 0 and A[i+] = 1 for some index for both A and B?

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

Video Editorial for Problem A,B,C,D.

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

Can anyone please tell error in my soln for problem C. I am getting WA on 2638th test case 3. 221366386

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

First two solution by recursion

1) Problem A

2) Problem B

Upvote If u like my solution

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

E is very cute

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

Can anyone provide a counter example for this submission for problem C — 221365170

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

I always find educational rounds tricky.

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

ABCDE are all doable but I wasted too much time on C just to figure out how to implement "properly".

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

Disappointed that i could't solve problem D during contest.It was doable and bit easier than usual problme D of educational rounds.

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

Hi all, it would really help if you can post some insights/hints for the problems of this contest on https://starlightps.org ! Here's a link to the problems: https://starlightps.org/problems/collection/cf-edu-154/. This will help us get more data so users can have a platform to:

  • share/discover hints/insights on various problems
  • find similar problems given insights they struggled with.

Check it out if you're interested. Thanks!

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

Had been solving 3rd problem from the last 6 contests, Couldn't solve this time

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

Why should there be no pretesets in problem C with |s| = 2 * 10^5?

I set my N ( MAXN ) equal to 10^5 and got time limit on system testing. :(

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

In problem c can anyone tell me where my code fails this on

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

Waiting for rating change.

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

hackational codeforces round

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

Can someone explain me why my code fails on problem C 221400131

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

When will editorial drop?

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

I am waiting for the moment to reclaim my blue.

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

Is there a math solution for problem E?

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

My solution for C got accepted during the contest, but it now shows TLE. Day ruined :(

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

why ML in B so tight, what is the point of cutting off dp solution ?

UPD: my bad, I know dp solution (221428793) can be implemented in O(n) space complexity, and I will more care about space complexity next time

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

I couldn't be any more unlucky. Missed 2100 by 1 rating point :(

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

What is case 58 of test 3 in problem D? I've been trying to figure out what's wrong with my solution since yesterday but I can't figure it out. Can someone tell me what that test is, or help me find a counter example for my solution? Link to my solution: Your text to link here...

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

Where is the editorial?

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

Problem E...

say DP(n) = total sum of costs of arrays of size n.

DP(n) = C(k) * (DP(n-k)+1) + C(k + 1) * (DP(n-k-1)+1) + ... + C(n) * (DP(0) + 1)

But I can't get formula for C(i), number of arrays of size i, such that only the last subsegment of length k has pairwise distinct elements.

Can someone help, please? ;((

EDIT: (mistake in DP(n), I think it should be: DP(n) = C(k) * (DP(n-k)+k^(n-k)) + C(k + 1) * (DP(n-k-1)+k^(n-k-1)) + ... + C(n) * (DP(0) + 1)

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

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

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

Does anyone know the 682th token for tc3 for C? My soln is here: soln although it maybe be abit unreadable

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

Overall good contest C was little tougher.

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

Why Was My Submission Skipped Despite Submitting First

https://mirror.codeforces.com/blog/entry/120756

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

NO