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

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

Некоторые спрашивали о заданиях жаутыковской олимпиады. Сильвупле

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

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

the content isn't working now: while opening file this message is found "the archive is either in unknown format or damaged"

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

Does anyone know how to solve 3rd problem (C problem) in better complexity than O(N*sqrt(N))?

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

    Consider a set of points (l, r) on plane such that 0 ≤ l ≤ r ≤ n - 1 where the point (l, r) corresponds to a segment [l, r].

    Consider some number x and all its occurrences. Suppose that the number x is one of the numbers that make some particular segment [l, r] be bad. Then one of the following situations should happen: either there are from 1 to x - 1 or more than x + 1 occurrences of x in [l, r]. That means that for the fixed l there are two segments of banned values for r. Actually, for any possible l lying between two consectuvie x's, those two banned segments for r will be the same. It can be reformulated that there are O(cx) banned rectangles on a plane that point (l, r) isn't allowed to be in, where cx is the number of occurrences of x.

    Construct all such rectangles for all numbers x, there will be O(n) of them in total, and then calculate the number of points that do not lie in any banned rectangle in via sweeping line.

    Although this solution has better time complexity, there are solutions that work even faster because they do not utilize much memory and use only simple operations.

    Code for reference:

    solution by me: http://pastebin.com/k0GHWxuQ

    solution by Errichto: http://pastebin.com/UXziv4iD

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

Can someone explain the solution of problem A Day1?

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

А сколько длится само соревнование ? И ещё, система проверки как на ИОИ или как на COCI ?

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

    Программа расчитана на 7 дней http://izho.kz/index.php/ct-menu-item-15/ct-menu-item-17 Но в этом году соревнование ( по программированию ) было два дня подряд по 5 часов и было 3 задачи. У задач были подзадачи и при прохождении всех тестов подзадачи Вам начислялись баллы этой подзадачи ( ну как в заочке ).