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

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

Привет! Надеюсь, вы скучали по мне :) Насколько можно судить по словам некоторых людей, из-за скопированного анонса этот раунд не будет интересным. Но правда в том, что сейчас я очень болен и я очень рад, что вообще смог приготовить этот раунд. Надеюсь, он вам понравится. Удачи всем!

<copy-pasted-part>

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

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

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

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

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

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

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

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

Удачи!

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

</copy-pasted-part>

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

UPD2:

Поздравляем победителей:

Место Участник Задач решено Штраф
1 WNSGB 7 206
2 kaixinqi 7 335
3 _sys 6 188
4 Moririn2528 6 206
5 CarusoX 6 212

Поздравляем лучших взломщиков:

Место Участник Число взломов
1 wanderer163 21
2 tokitsukaze 14
3 Fe4RLess 6
4 smit.mangukiya 4
5 chandak_vikas 4
Было сделано 93 успешных и 132 неудачных взломов.

И, наконец, поздравляем людей, отправивших первое полное решение по задаче:

Задача Участник Штраф
A anurag918273 0:02
B probIem-solving 0:07
C Shuba_realniy_krasav4ik 0:05
D vnquynh_hac_am 0:12
E probIem-solving 0:28
F lxr_love_yxh 0:16
G IZONE 0:20

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

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

Скорейшего выздоровления, vovuh!

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

Привет! В воскресенье, 31 марта 2019 г. в 16:05UTC+2 начнётся Codeforces Beta Round #86 (Div. 2 Only) — очередной Codeforces раунд для третьего дивизиона.

Даже скопированную часть мы читаем!)

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

    Забавно, что это только в одном месте из четырех (2 в английской версии, 2 в русской). Забыл одну четверку в номере соревнования :) Спасибо большое, что заметили! Исправлено

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

It hardly matters if you are sick.

Your rounds are always good enough vovuh

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

Выздораливайте поскорее, ваши div3 контесты делают меня счастливее =))

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

what is mean by copy pasted round ????

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

Div 3's are always a great way to boost up the ratings.

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

Будем надеяться, что задачки (для людей с рейтингом меньше 1600) будут интересными!) Спасибо большое vovuh, и желаю выздоровления!

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

Could you make the contest late 1 or 2 Hours cause I Have an exam And I want enter the contest I'm travelling so i Can't get in time I Would be grateful. Thank you :) vovuh

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

I hope this round will focus on your problem solving skills rather than speed :) Really love your contests Vovuh :)

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

Wanna refresh your algo paradigms? Go for a Vovuh round :)

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

Will there be any interactive problem?

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

Bug happened! Hope it will be solved soon

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

Can you tell us about the exactly number of problems? Don,2019-03-31't tell me 6 or 7 or 8.

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

I am outside and may not participate in today's contest or can't join in time. Though the contest is not rated for me, still I am hurt and that's the love for contest not for rating.

And if this was a rated round for me I must postpone my work to participate in the contest, that's the love for codeforces rating.

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

My CF account automatically logs out sometimes. Anyone else having this problem? Someone might miss a last minute submission during contest because of it.

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

What is the testcase # 8 in D ??????

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

How to solve E and F?

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

What's the logic for D. I thought of max repeating element as the no. and got the wrong answer at TC: 8

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

How to solve G?

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

    Maintain two sorted arrays. For a new element $$$x$$$, if it can be appended to only one of the arrays, do it. If it can be appended to neither, the answer is no. If it can be appended to both, check the next element $$$y$$$, if $$$y \gt x$$$, then append $$$x$$$ to the increasing one, otherwise append $$$x$$$ to the decreasing one. One can prove this is always optimal.

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

    Another solution using LIS. Find the LIS and the rest of numbers should be Decreasing, if not we can prove that you only need to swap one number from LIS with one of the rest and there are a few valid cases for swap. 52133834

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

      Why is it possible with only one swap? any intuition?

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

        UPD: So basically that I meant in the previous revision is that exists one LONGEST Increasing Subsecuence such that after eliminating it the rest of elements are decreasing or not exists any solution.

        I will try to make the explanation more clear:

        Let $$$DS$$$ be the rest of the elements that are not in some $$$LIS$$$.

        • If $$$DS$$$ is decreasing you are done!

        If not:

        • You can't transfer two or more elements from $$$LIS$$$ to $$$DS$$$ (because you put a increasing subsecuence in the $$$DS$$$)

        • So at most one element from $$$LIS$$$ should be changed to $$$DS$$$:

        1. If none of the elements of $$$LIS$$$ is transferred to $$$DS$$$, then no one from $$$DS$$$ can be transferred to $$$LIS$$$, because this increase the size by one, which is a contradiction because the $$$LIS$$$ is the longest.
        2. If one element of $$$LIS$$$ is transferred to $$$DS$$$, afther added them in $$$DS$$$, $$$DS$$$ still invalid, so it's necessary send some (only one) element of $$$DS$$$ to $$$LIS$$$ (only one because if I send two or more the size of $$$LIS$$$ become greater that the longest increasing subsecuence => contradiction)

        The elements that you need to swap are (it's easy to see that if you not swap these elements, then the solution still invalid):

        • Find the first time in the $$$DS$$$ that there are two elements that increase consecutively, try sending one of them to $$$LIS$$$, then when the element is inserted in $$$LIS$$$, try to move the element to its left or right to $$$DS$$$ and finally check that $$$DS$$$ is decreasing and $$$LIS$$$ is increasing for all the above four combinations.
»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

A contest of applying sorting algorithm :3

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

To be honest, this was the most balanced problem set, in recent contests. Even though yesterday's one was also quite balanced, this one was a perfect set.

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

I code in C++ and I was having a little trouble in Problem A. When I tested my code on my own compiler (I use the GNU GCC Compiler on CodeBlocks) for the given test case, I obtained the correct answer. However, when I submitted the same using the G++14 compiler on CF, the judgement showed a wrong answer for test 1.

After the contest had finished, I saw that the answer printed by the CF compiler was different from that printed by the CodeBlocks compiler. Since then I have tried all C++ compilers available on CF and none of them gave me the desired answer. Does anyone have any suggestions on how I can fix this problem?

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

Really great contest! Enjoyed the problems a lot.

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

How to solve F?

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

Когда будет опубликован разбор ?

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

I forgot to put abs around (odd.size() — even.size()) in problem B. Go ahead challenge it. https://codeforces.me/contest/1144/submission/52089891.

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

Could somebody tell me what is traversed edge in problem F, I had think some time but fail to work out it, I just want to know what’s the traversed edge mean,Thanks

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

I don't know how to hack my second solution of problem G.52114369

My first solution is to find the longest increasing subsequence and check if the remaining numbers satisfy the decrement. Or find the longest decreasing subsequence and check if the remaining numbers satisfy the increment. If not, it is No.

The solution was hacked by test 30:

6

1 2 100 3 101 4

Because [1 2 3 4] was found when looking for the longest increasing subsequence. When looking for the longest decreasing subsequence, I found [101 4].

Then when I look for the longest incrementing subsequence, after the penultimate number, I find the largest number and replace the last one with it. This finds [1 2 3 101], which just passed test 30. In the same way, when looking for the longest declining subsequence,find the smallest number and replace.

This is my second solution.I think there are still some mistakes,but I don't know how to hack it.

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

Is there any way to boost this python solution for E? I think the time complexity is good enough, just the problem is in the performance of Python itself.

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

    In no way is that a problem with Python. What you've written there is essentially a $$$O(n^2)$$$ algorithm. Every time you mult by 26 or divide by 26 it has to do the calculation on the entire integer. As the integer is already $$$O(n)$$$ big every operation takes $$$O(n)$$$.

    There are ways to get around this. Python's int(str,base) allows you to read a number in the base 26 in $$$O(n)$$$. But unfortunately there isn't any built in way to print a large integer in base 26 in $$$O(n)$$$ as far as I know.

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

for problem g is this correct approach? let say i have two array X(increasing),Y(decreasing) and A is Merge(X,Y). Find the longest increasing sequence of A this sequence will contain X and atmost one element of Y and after removing that element from Y Y will still remain decreasing.

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

    The solution is correct in the case where the length of $$$LIS$$$ of $$$A$$$ is equal to (length of $$$X + 1$$$). The reason for this is, as you said, after removing one element from $$$Y$$$, it still remains decreasing. But, when $$$LIS$$$ of $$$A$$$ has length equal to length of $$$X$$$, then the remainder sequence $$$R$$$ (after removing $$$LIS$$$) may not be decreasing. Consider the case where $$$Y = [4, 3, 2]$$$, $$$X = [2, 3, 4, 5]$$$, $$$A = [4, 2, 3, 2, 3, 4, 5]$$$. $$$LIS = [2, 3, 4, 5]$$$, $$$R = [4, 2 ,3]$$$

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

hello, in the statement of problem 'D', I didn't understand this line:: "Note that after each operation each element of the current array should not exceed 10^18 by absolute value."

Could you please elaborate it??

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

Is is possible to have multiple solution for problem F..

help please ?