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

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

Всем привет!

text

Окончательные результаты Условия задач

В эти выходные 8-9 декабря в Санкт-Петербурге, Барнауле, Кременчуге, Тбилиси, Алматы и Сочи пройдет XIX открытая Всероссийская командная олимпиада школьников по программированию, в которой примет участие более 250 команд. В Сочи ВКОШП проходит впервые, и в этом году Образовательный центр Сириус примет у себя девять команд.

Тур начнется в воскресенье 9 декабря в 10:00. За текущими результатами можно будет следить по ссылке. А после начала тура мы добавим ссылку на условия задач.

Для тех, кто не является участником, но тоже хочет порешать интересные задачи от жюри ВКОШП, будет доступно зеркало, которое начнется в 09.12.2018 11:05 (Московское время). Не присоединяйтесь к нашим трансляциям, если вы планируете принять участие в зеркале, ведь там могут быть спойлеры к задачам. И, конечно, не открывайте условия задач до начала раунда.

UPD: медалистами чемпионата стали:

  1. Москва, 57 + 179: "Пурпурный виноград"
  2. Сборная команда Казани, Лицей КФУ + СПб, ФМЛ 239: "Мертвые души"
  3. Казань, "Преимущественно овощи"
  4. Москва, Интеллектуал #1: "Red Gate"
  5. СПб, ФТШ + 239 + Всеволожск, 6: "Проблемы с Поллардом?"
  6. Алматы, РФМШ: "Чудо Зверята!"
  7. Тбилиси, Школа 199 (им. Комарова) #1: "Komarovi+Mziuri 1"
  8. Москва, СУНЦ МГУ #1: "Вова спит дома"
  9. Москва, 179: "У вас математик есть, чтобы это делать"
  10. Самара + Москва, Гимназия 1 + Школа 97 + СамЛИТ: "МГУ"
  11. Челябинск, Лицей 31: "Пыльная Испания"
  12. Могилёв, Гимназия 2: "Могилёвские орлы"
  13. Москва, СУНЦ МГУ #3: "Ланемия #17"
  14. Москва, 1540: Tinkoff + СУНЦ: "neteam"
  15. Екатеринбург, СУНЦ УРФУ + Гимназия 9: "Жизнь прекрасна"

Если вы не пишите зеркало, то обязательно присоединяйтесь к нашим трансляциям. Для вас, как обычно, будет проводиться трансляция в видеоформате от команды ICPCLive и в текстовом формате в нашем Telegram-канале.

А если вы хотите прийти на ВКОШП в Санкт-Петербурге гостем — заполните гостевую форму и получите свой бейдж на регистрации!

У ismagilov.code в посте есть ссылка на большой набор команд с суммарным рейтингом. Спасибо за интересную информацию!

А вот некоторые команды, у которых есть неплохой шанс стать обладателями кубка:

Команда Город Участник 1 Участник 2 Участник 3 Рейтинг
Мертвые души Казань + СПб Морозов Александр 
scanhex
Гайнуллин Ильдар 
300iq
Крамник Сергей 5641
Вова спит дома Москва Романов Владимир 
voidmax
Колодезный Александр
Aleksandr2754
Шеховцов Александр
Jatana
6854
Чудо Зверята! Алматы Закарин Данияр
YaKon4ick
Сардарбеков Батыр
998kover
Джанкуразов Руслан
ruslanjan
6727
danya.smelskiy Кременчуг Мельник София
Sonechko
Зуб Максим
MaxZubec
Деньга Назарий
Nazikk
6701
Проблемы с Поллардом? СПб, Всеволожск Карнаухов Кирилл
kkarnauk
Ефремов Андрей 
receed
Одинцов Андрей
forestryks
6660
Komarovi+Mziuri 1 Тбилиси Birkadze Nika
saba2000
Toloraia Teimuraz
Temotoloraia
Gamezardashvili Baqar
baqargam
6597
Пурпурный виноград Москва Савкин Семён
cookiedoth
Куянов Фёдор
Kuyan
Пискалов Дмитрий
TheWayISteppedOutTheCar
6558
Пыльная Испания Челябинск Будников Михаил
Mlxa
Григорьев Савелий 
sava-cska
Ахметшин Кирилл
liriKl
6529

Подписывайтесь на нас!

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

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

It's gonna be cool^^

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

когда это 300iq успел ВКОШП выиграть?

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

What is testcase 2 in problem Minimal product

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

In F How to prove solution is always unique given you ask all nC3 queries.

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

    You can ask all 10 queries for 5 elements of the array. Let those element in sorted order be a,b,c,d,e. Let xi be sum of returned values in all queries in which ith element was involved. Sort them, Then, you can form 5 linear equations using the returned values.(6e+3a+2b+c=x5, 3e+3d+3a+2b+c=x4, 3e+2d+2c+3a+2b=x3, 3a+3b+3e+2d+c=x2, 6a+3e+2d+c=x1) If you solve those linear equations their solution is always unique for any xi. Thus, we can uniquely determine these 5 elements. Similarly, thus you can uniquely determine all of the elements for the constraints(n>=5).
    My solution with precomputed inverse matrix of above linear equations 46821561

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

How to solve Problem I Minimal product

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

    You are given an array of size N, now your task is two find two indices i and j such that i < j, A[i] < A[j], and A[i] * A[j] is as minimal as possible across all possible valid pairs. Since an O(N²) solution is straight forward, we will discuss how to solve this in O(N).

    The final state of the answer is dependent on whether the answer is positive or negative, so we will split the answer in three cases, and solve individually for each.

    Answer is negative, so A[i] * A[j] < 0 for optimally chosen i, and j. In this case, it is easy to solve as only one element can be negative, which follows that it must be A[i], since A[i] < A[j] from the problem conditions. Solving this is simple, we need to maintain a prefix minimum across all the array, then for every element A[i], it can contribute to the above case iff prefix_minimum[i] * A[i] < 0, then for all valid indices, we need to minimize the answer over prefix_minimum[i] * A[i], where prefix_min[i] is equal to minimum(prefix_minimum[i — 1], A[i]).

    1. Answer is positive, with A[i] ≥ 0 and A[j] ≥ 0, for optimally chosen i, and j.

    This case is easy to solve as well, for each element we just need to minimize over A[i] * prefix_min[i], if A[i] > prefix_min[i].

    1. Answer is positive, with A[i] < 0 and A[j] < 0, for optimally chosen i, and j.

    This is really the interesting case, since both numbers are negative, we should greedily try to multiply numbers with minimum absolute value. For example, multiplying -3 by -2, is more beneficial than say, multiplying -20 and -25, even though -3, and -2 are larger numbers. This makes the greedy approach used in case #1, and #2 fail to arrive at an optimal solution.

    Let’s try to come with another strategy, we can notice that once a negative number A[j] appears in the array, it will never be beneficial to pair any element less than A[j] at position < j, with any element after j. More formally, Let’s denote our indices as i, j, and k, where i < j < k, A[i] < A[j], and A[i], A[j], A[k] < 0. Then, A[k] * A[j] < A[i] * A[k] for all k.

    In another words, we should try and match each index with every non matched yet index to it’s left that is less than it. At first sight, this looks like O(N²), but with careful implementation we can achieve O(N) in amortized time. We will be using a monotone stack ( a stack where every value is increasing from bottom to top). Before we push an element to the stack, we keep popping every element less than it, and minimize over this pair, otherwise we stop, and push that element. We are essentially simulating the idea in the previous paragraph. This is a smart brute-force that combines greedy to only iterate over possibly interesting pairs.

    Here’s a snippet: https://ideone.com/FxK16x

    You still have to construct the array using a generator, here’s a spoiler on how to do it efficiently, you can use an unsigned int data type for your array.

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

Problem I: unsigned int l and r (very stupid mistake (must be int)) and O(N2) solution passes 12 test cases...

Is this a coincidence or on purpose?

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

Почему нельзя писать виртуально?

UPD: работает

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

Why is it not possible to submit in practice mode? I wasn't registered for the round.

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

When will the solutions become available?

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

How to solve L?

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

    Let's make a function f(x) that will tell us how many lections we can provide for each student in group of x students.

    One of the possible optimal schedule patterns is greedy: fill empty slot in it with the number of student with least lections attended. Consider x = 6, n = 5, a = 5, b = 3: schedule is:

    Day 1: 1 2 3 4 5
    Day 2: 6 1 2
    Day 3: 3 4 5 6 1
    Day 4: 2 3 4
    Day 5: 5 6 1 2 3
    

    This way each student attends at least 3 lections. So f(6) = 3 in this case. We can show that result of this function is equal to , where slots is the sum of students capacity over all days. Note, that in case when a > x or b > x we cannot put more than x students in one day. So the final formula is:

    This function is monotonic. f(v) ≤ f(u) for v > u. Now we can make a binary search over x to find maximum amount of students that each student can attend at least k lections.

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

Can you please provide an editorial?

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

In question I Minimal product the array b has to be declared as unsigned long long

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

Приятно видеть на ВКОШПе задачу с самарского контеста)

(но плагиата скорее не было — сильно разные сеттинги)

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

Является ли K популярной проблемой? И где можно найти разбор?

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

How to solve problem J? Definitely brute force isn't gonna work.

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

Can anyone explain why my hash code can't get through the test set 12 in problem K even though I have changed the hash value so many time ? Is it some kind of ati-hash test or something ? I changed the code to store the whole string and it got AC.

AC code : 46843561

WA code : 46843449

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

Can someone explain their approach for J?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится
    Solution, Part 1:
»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

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

why my O(n) solution is giving tle on testcase 13. code — https://codeforces.com/contest/1090/submission/46848255

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

why my O(n) solution is giving tle on testcase 13. code — https://codeforces.com/contest/1090/submission/46848255

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

    Here's a puzzle for you: try to find the difference: 46856549 and then explain why this is significantly faster.

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

      The only difference is making mod1 const , i tried to search about it and i found since we cant change the value of a const so compiler can perform optimised operations and since i am using mod1 many times in my code , so overall it makes a significant difference . Although i am not completely sure thats the reason ..

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

Если я правильно понял и медальки это награды IOI, то Sonechko и Nazikk серебряные призеры IOI 2018.

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

Не приятно было когда в закрытии школьники слушали рекламу от КазГу полтара часа и песню от профессора-математика. Не хочу задеть чуство организаторов. Но прошу обратить на эту внимание следующим году .

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

Where can I see the editorial for the problems?