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

Автор vovuh, история, 6 лет назад, По-русски

<almost-copy-pasted-part>

Привет! В 12.12.2019 16:35 (Московское время) начнётся Codeforces Round 605 (Div. 3) — очередной Codeforces раунд для третьего дивизиона. В этом раунде будет 6 или 7 задач (или 8), которые подобраны по сложности так, чтобы составить интересное соревнование для участников с рейтингами до 1600. Однако все желающие, чей рейтинг 1600 и выше могут зарегистрироваться на раунд вне конкурса.

Раунд пройдет по правилам образовательных раундов. Таким образом, во время раунда задачи будут тестироваться на предварительных тестах, а после раунда будет 12-ти часовая фаза открытых взломов. Я постарался сделать приличные тесты — так же как и вы буду расстроен, если у многих попадают решения после окончания контеста.

Вам будет предложено 6 или 7 (или 8) задач и 2 часа на их решение.

Штраф за неверную попытку в этом раунде (и последующих Div. 3 раундах) будет равняться 10 минутам.

Напоминаем, что в таблицу официальных результатов попадут только достоверные участники третьего дивизиона. Как написано по ссылке — это вынужденная мера для борьбы с неспортивным поведением. Для квалификации в качестве достоверного участника третьего дивизиона надо:

  • принять участие не менее чем в двух рейтинговых раундах (и решить в каждом из них хотя бы одну задачу),
  • не иметь в рейтинге точку 1900 или выше.

Независимо от того являетесь вы достоверными участниками третьего дивизиона или нет, если ваш рейтинг менее 1600, то раунд для вас будет рейтинговым.

Спасибо MikeMirzayanov за платформы, помощь с идеями для задач и координацию моей работы. Спасибо моим очень хорошим друзьям Дарье nooinenoojno Степановой, Михаилу awoo Пикляеву, Максиму Neon Мещерякову и Ивану BledDest Андросову за помощь в подготовке и тестирование раунда.

Удачи!

Также хочу сказать, что участники, намеренно отправляющие неверные решения и взламывающие их после окончания соревнования (пример), не будут показаны в таблице лидеров по взломам.

</almost-copy-pasted-part>

UPD: Огромное спасибо Артему Rox Плоткину и Дмитрию _overrated_ Умнову за тестирование раунда и помощь с исправлениями ошибками! Артем также предложил одну из задач на сегодняшний раунд!

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

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

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

Hope to see non-black IDs win this contest(for whom this isn't first contest)

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

Непривычно видеть vovuh желтым :)

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

Anyways I hope high ratings to all the non-black handles

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

vovuh one love

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

Orange vovuh

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

I think it is the first round made by vovuh as a Master . Good Luck and I hope the contest will be nice .

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

Add the information to the right to capture the audience.e.

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

will 15 december held two contest?

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

After a long time Codeforces arranged a contest. I am waiting for this contest. I think, the contest will be nice and interesting for me and also for others. Thanks to MikeMirzayanov and vovuh for arranging the [Codeforces Round #605 (Div. 3)] contest.

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

hoping to qualify for Codeforces platinum!

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

79353118_444821413104507_8018561245638557696_n2.jpg

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

А где регистрация или ее нету?

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

Is the scoring (points per problem) known?

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

codeforces server seems to be broken same code giving diffrent output on my macinhe and server on my machine my code passes the same code while on server produces wrong ans i got 3 penalities due to that still not able to submit ..

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

Can anyone hack this solution 66706230?

UPD: Hacked, thx dead_blue!

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

How to solve D? I kept going in circles thinking about stack and non-positive difference...:(

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

    I can't tell you how to solve it in English, but you can check my solution, maybe it will help you. https://mirror.codeforces.com/contest/1272/submission/66702493

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

    Maintain 2 arrays, Increasing and Decreasing. Increasing[i] will store maximum increasing subarray till ith element, similarly Decreasing[i]. For each element check if (i+1)th element is greater than (i-1)th element, If true, then we can delete this element and updated ans=max(ans, Inc[i-1] + Dec[i+1]).

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

      Elegant Solution, can you explain why this holds?

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

      I didn't use this dp approach. The following is the algorithm I came up with. First find all strictly increasing continuous subarray and store each such subarray's start and end index as an interval. Update the max length for each interval.

      Then iterate through all intervals and check every two adjacent intervals and do the following. 1. if the current interval only has 1 element, remove it, get the next interval if possible and check if the previous interval and this next interval can form a longer strictly increasing subarray. Update max length if necessary.

      1. else if the current interval has more than 1 element, 2a.if the previous interval has more than 1 element, remove the last element of the previous interval and check if the previous and current interval can give a better answer. 2b. else if the previous interval has only 1 element, remove the first element of the current interval and check if the previous and current interval can give a better answer.

      The above solution fails on test 14 by a difference of 1. Can you help explain why this solution is incorrect? My submission is 66729847. Thanks!

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

        Your idea is almost same as me.

        I stored all strictly increasing sub_sequence block.

        Then updated result by comparing all block size.

        After that i took 2 consecutive block each time. If 1st block has size > 1, then we compare the 2nd element from last of 1st block with 1st element of 2nd block. if a < b then we have a length of block1+block2-1. Similarly i checked by ignoring 1st element of 2nd block.

        https://mirror.codeforces.com/contest/1272/submission/66754733

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

          Yeah, I think our idea are similar in general, except that I made the mistake of comparing value with index in one of the if statement, if only I could realize that during contest :(

          Thanks for replying though, without comparing your code I probably wouldn't even realize that bug in my code.

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

    do dp. dp1[i] = maximum length of increasing contigous subarray having the element of i from 0 to n. dp2[i] = maximum length of increasing contigous subarray having the element of i from n — 1 to i. Find out max length of subarray without removing element.Initially, this is the ans. And then, for every i from 1 to n — 2, check if(dp1[i — 1] + dp2[i + 1] > ans && v[i — 1] < v[i + 1]), if yes, then ans = dp1[i — 1] + dp2[i + 1]. That's it.

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

    Let pre[i] be the maximum possible length of strictly increasing contiguous subarray of array a from index 0 to index i

    Let suf[i] be the maximum possible length of strictly increasing contiguous subarray of array a from index n — 1 to index i

    Loop from i = 1 to n — 2, if a[i — 1] < a[i + 1], then ans = max(ans, pre[i — 1] + suf[i + 1]).

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

    very similar to this problem: PIBRO

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

    This AtCoder Problem is also an interesting one that you can solve using the above technique:

    GCD On Blackboard https://atcoder.jp/contests/abc125/tasks/abc125_c

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

    I've made a string of 0 and 1 of length N-1, where 1 means $$$a_i \lt a_{i+1}$$$.
    Then applied a regex / 1+ 0 1+ /x, and checked elements near matched 0 if they increase after one deletion (i.e. if exists $$$j$$$ that $$$a_j \lt a_{j+2}$$$, where $$$j$$$ is near 0). Perl code 66779749.

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

How to solve F? LCS and some post-processing?

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

Any hints for E?

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

How to solve E. I thought of bfs + dp but couldn't implement.

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

There is no constrain in problem B that length of string cannot be zero. Empty space should also be taken as correct input. Attempting to use this testcase for hacking shows invalid input. Is this intended?

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

    There are no empty strings in every test and empty strings are not allowed to input at all. Seems like it would be better to mark this in the problem statement more clearly.

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

66723421 ohhhhhh, I should go to E when my D's solution is wrong that taken too much time to debug.

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

Am I the only one who accessed CF from http://m1.codeforces.com after solving A ?

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

Every day I have headache there is got to be a CF round SMH.

and I think I'm the only person who solved E but not D.

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

https://codefoces.com not working during the contest and I was thinking that my internet stopped working wasted my 10minutes

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

The server was down throughout the contest. Did I only face the issue??

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

Organizers please make the contest unrated as the site was down during the contest.

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

I think the internet issue / connectivity was the problem and not codeforces "down"

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

Need help in E. I thought of the dp solution, i.e let's start visiting every element and finding whether the given conditions satisfy or not. 66716159

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

MikeMirzayanov it is a request. I wasn't able to access the codeforces website after 9 minutes and hence wasn't able to continue with the contest after a wrong submission of A. This is leading a drastic rating drop for me. It is hence my humble request that if it be possible then please do not allow for my rating to change. As a proof that I could have done it, I have submitted another solution of A with a minor tweak. It works just fine and I was ready with it after a minute of my wrong submission but wasn't able to access codeforces due to unavoidable circumstances. I hope you'll help me in any way if possible.

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

i got a small problem in my code in problem F if someone can help me i just did dp[curr positions in s1][curr position is s2][diff between open and closed brackets] i will represent it as dp[curr1][curr2][val] i can made transitions just if after the transition the val will stay non-negative and then i know the length of the answer is less than or equal to 400 so if length > 400 or the val is > 200 i will just return inf that is my first submission 66726623 which just returned inf and that is my other submission 66727771 which i just return when siz > 1000 and it got accepted can someone explain the what is the problem please ?

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

Thank You vovuh I Loved this contest and I Love Div Three <3

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

Please give hint for F.

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

I felt F was implementation heavy for those who are comfortable with top-down dp, especially the backtracking part.

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

If you can't wait to see the official editorial, come to see My Unofficial Editorial :)
Like to see comments and responses from you guys!

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

Can anyone explain how to approach problem B?

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

How would you do E? I tried BFS with adjacency vector, but no avail :(. It gives TLE on test 8.

UPD 1: I tried again this time with an array that stores the closest node with opposite parity to make my code faster. Also TLE on test case 8.

66742260

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

    After moving to position 10, you can make 1 more move to position 6 (10 — 4 = 6), position 6 has value 5 which is odd. So that is why the answer is 3.

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

      the answer for 10th position is 1. the answer for 8th position is 3 because : first you move to (8-4)=4th position which has value 6 which is also even (val(8)==4) so you have to move again to pos (4+6)=10 which has value 4 . then you move to pos 6 which has value 5 that is odd . 3 moves

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

"Can't read or parse problem descriptor"-Anybody else having this problem?

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

what is the idea for problem D

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

What is the logic behind problem E

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

I still can't figure out why this code gives a negative result for problem A.

Somebody help me finding the bug which I can't find. Here's the code 66703687

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

Can I know why I got skipped

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

My rating should have increased by 9 according to CF Predictor but instead it decreased by 5??

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

when the editorial will be published...??

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

Is there some error in rating change? The rating predictor predicted a +102 while I got only +74. How such a huge difference?

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

Low tests in D problem :( My submission got passed but then failed at test 39.

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

Автокомментарий: текст был обновлен пользователем vovuh (предыдущая версия, новая версия, сравнить).

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

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

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

Problem D is very similar to this problem.

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

Screencast of my testing is available

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

please help to find out what's wrong in my solution of problem E https://mirror.codeforces.com/contest/1272/submission/79720918