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

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

Добрый день!

VK Cup 2015 — Раунд 1 (неофиц. интернет-трансляция, только Div. 1) — это неофициальный повтор Раунда 1, открытый для всех участников из первого дивизиона. Это означает, что если вы не принимали участие в VK Cup 2015 (например, вы старше 23 лет), решили прекратить участие в нем или не прошли квалификацию, то вы можете зарегистрироваться на VK Cup 2015 — Раунд 1 (неофиц. интернет-трансляция, только Div. 1) и принять в нем участие.

В интернет-трансляция — соревнование с индивидуальным (не командным) участием, по результатам трансляции будет пересчитан рейтинг всем ее участникам. Задачи будут предложены как на русском, там и английском языках.

На соревновании будет использована плавная динамическая система (с шагом 250). Подробнее о ней можно прочесть здесь.

Не забудьте зарегистрироваться заранее на раунд. Желаем удачи!

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

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

При попытке зарегистрироваться, я получаю alert "Unsupported participation type"

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

as i can see there is a time difference from the original round and the mirror round. Does the problem set could have seen before the round starts?

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

    No, it will not be published for non-VK Cup participants, and VK Cup participants will not be able to take part in online mirror.

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

I am not going to be participating in the mirror, but I would like to ask a question on behalf of those who will be. How you will prevent cheaters who will compete in the VK round and then compete with another account in the mirror round? I am quite sure that there are highly rated people with additional d1 rated account, as we see in d2 competitions often times new accounts show up, place in the top 10, and then never do anything again. Of course one could say that this is against the terms of service, and is cheating obviously, but as we can see from d2 results this often does not stop people. In addition this time the reward for these cheaters is much greater. If they are already willing to cheat to try and win a d2 contest, would they not want to cheat even more when they have the opportunity to win a d1 round by spending 4.5 hours solving the problems. This is why if I were a red competitor I would be very scared about participating in this mirror, because what happens when you end up competing with a cheater who is actually red in real life, and has 2.5 hours to spend on the problems before you start? The answer it seems is that the honest red's rating will go way down. Anyway I hope I am wrong about this, and that the ethics of the Codeforces community will prevail, however I sadly will not be surprised to find tomorrow at the end of the mirror round several purples with only 1 previous round competed in at the top of the leaderboard, and this will be very sad for all the rest of us.

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

    This round is something like an experiment. Actually, I do not see much motivation to cheat here: it is hard, but it is possible to understand persons who register new accounts to be in top of D2-rounds. It could be fun for someone, but in case of this round I don't see any fun. It is not funny, but boring to solve problems if you saw them before.

    We had an option here: to host only VK Round 1 or to add an event for everyone. I think that it is better to trust participants and to organize contests than to suspect everybody and not to do contests. You see, programming contests mostly have many ways to cheat but I don't think that is the reason not to do contests.

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

    So good luck.

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

Why is it for div1 only? Only because estimated difficulty of problemset is too high for div2 users, or there are some other reasons behind this?

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

    Probably for that reason. It's also quite interesting: round 1 already is too hard for div1?

    Maybe there just aren't easy problems.

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

      I have no stats about distribution of qualified contestants by color, but right now among 375 registered teams (in official Round 1) only 214 have team rating >=1700, and for individual ratings stats are even worse. So these guys will have a hard time in case of hard problemset.

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

    I guess one reason would be to discourage cheating? If you can create a new account and immediately join, then cheating is much more appealing than using your main Div1 account. And in this particular case cheating is relatively easy as the official round is before the unofficial one, and the tasks could easily be leaked.

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

Atleast, out of competition for Div 2?

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

Рейтинг будет пересчитываться отдельно для основного тура и отдельно для зеркала, так как будто это два разных соревнования?

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

Unofficial But Rated : WOW.

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

Unofficial But Rated : WOW.

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

Where is official VK Cup 2015 Round 1 ? it's not in contests anymore, there is only mirror of it

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

i love contest i want register i hate you div1 only MikeMirzayanov is it problem if div2 coders register and contest will be unrated for them?

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

I encourage these teams to respect the position of the organizers and not to take part in official Round 1.

You ask us to not participate in the official VK Cup, however you make the unofficial Round Div 1 only.

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

Can we do gym contest while the VK cup round goes on !! I m in div2 , so want to practise there .

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

We do not have a heart? We want VK Cup

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

We do not have a heart? We want VK Cup

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

Are the problems sorted in order of difficulty?

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

This contest is only for Div 1 and it is rated . I think many coder's are unfortunately goes Div 2 Because it is rated. lol.....

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

The site is not letting me register.. At first it said "My submission for C has been hacked" even though the contest hasn't started.

Now its giving me a popup telling me that i'm registered, but nothing happens and I'm not on the registration list

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

    Popup has been sent by error in website because of teams participation.

    Are you sure that you didn't confuse between offcial R1 and internet-mirror?

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

This contest is Hello 1394(Iran). Happy new year and wish good rate

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

Delayed 15 mins :_(

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

One more postpone with 5 minutes and I win 100 dollars to my friend.

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

I got bored, so let me spend those few minutes before the contest by writing a joke:

If you have a homework that need at least two hours of working , how can you do it in only five minutes??

just do the homework in last 5 minutes before the starting time of a contest on codeforces because it feels like 2 hours.

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

Well, no cheaters because of delay?

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

    Actually, E was the easiest problem.

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

      I found B easier. And expect a lot of sysfails on E because there were hacks on that problem on main event

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

        Mhm, maybe. B, D and E seemed about the same difficulty to me, but it had the most submissions very quickly.

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

      Yes, I understand. But to code it in 3 minutes when at official round it took at least 10 minutes for the first team? And one more important point: a lot of coders start to read from A at CF rounds. So, to read & understand at least two problems and then implement it so quickly? I'm not sure...

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

Where is rooms?

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

rated?

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

Мы участвовали в официальном раунде. На трансляцию не регистрировались. Вот как выглядит список задач, если войти в трансляцию:  При этом, это не соответсвует множеству тех задач, что мы заслали в официальном раунде. Нажатие на замок ни к чему не приводит.

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

    Задачи B,C — не такие же.

    A, E — вы сдавали?

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

      Нет, спасибо. Это отвечает на вопрос "почему присутствуют зелёные", но остаётся два вопроса "почему отсутствуют красные" (посылки по A & E были) и "почему там замок"?

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

First time to see a contest in which E is the easiest problem :D

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

    E — Easy
    B — Basically easy
    D — Doesn't seem like greedy, but it is!
    C — Can't be bothered to make a funny name for the letter... oh wait
    A — Aw shit!

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

      Can you tell your solution of problem C?

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

        I didn't read it, I spent the last 40 minutes solving A (I don't know where I fail, since my approach uses quite general approaches).

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

        For each query, you want to know if there is a rook at every row/column of the special area.

        At least for my solution, you need to check the conditions separately for rows and columns. For the rows: sort the queries by increasing order of x1, then for all rows keep the leftmost rook such that xR ≥ x1. The query is valid if xR ≤ x2 for all rows (use a segment tree to check that).

        Do the same for the columns, and take the queries that passed any of the tests.

        This seems pretty annoying to code though, I wonder if anyone has something easier.

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

          This should be simpler:

          1. Check the rows
          2. Rotate the board and flip queries
          3. Check the rows
        • »
          »
          »
          »
          »
          9 лет назад, # ^ |
          Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

          i got the same idea after this contest, but how to built a segment tree to get how many elements are greater than some value(i sweep from left to right).

          I know how to solve with SQRT descomposition, but querys with that is too expensive O(sqrtN * log(sqrtN)), updates in O(sqrtN), with segment tree, i don't have the faintest idea how to do that.

          Any hint with segment trees please?

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

            You don't need to know "how many", all you need to know is whether there is at least one or not. Similar example: on the given interval you need to check if there is any number greater than X. That can be solved by taking maximal value on the interval and comparing it with X.

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

              haha, i understand, just in my case maximal value is enough, but about how many element greater than some value, is possible to do that with segment tree?

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

                One of the ways to solve this problem: for every vertex of a tree store sorted list of all entries of rooks at it's segment, and also for every rook remember it's position in this list for every vertex it belongs to. And also build a fenwick tree in every vertex.

                Now do basically the same as in simple solution — move column by column, when you meet new rook — remove previous rook at this row (if exist) and add this one. But in simple solution you were only updating a value of minimum in some vertices of a tree, and here you have to update Fenwick trees for all affected vertices. You should update those trees in such way that there are always 1's for entries which are last at their horizontal line right now and 0's for everything else.

                Now to answer query "how many?" for vertex you need to count sum at some suffix of Fenwick tree for this vertex.

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

        The rectangle is defended by rooks if and only if it either has rooks on every row or it has rooks on every column (both taking only rectangle's range into account). Since those two are symmetrical I will describe only how to check whether there is a rook on every row. We will answer the queries in offline, sort queries by their left border and go left to right. Sort the rooks left to right as well. Now going left to right you need to remove the rooks from the board which are to the left of the query currently being checked. If you remove such rooks then for each row you can check what is the leftmost rook in that row. If you take max of these values across all rows in the rectangle (using interval tree for example) and compare the result with rectangle's right edge you will find whether it has any rooks missing or not.

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

        You can also use interval trees for a different solution. Again, this is to check just if every column has a rook.

        Keep for each column the intervals where you dont have rooks (if you have rooks at y's 1 2 5 on a column you have the intervals 3-4 and 6-M). You build a segment tree over these intervals and in a subset of columns (x .. (x + y) / 2, (x + y) / 2 + 1 .. y) you keep all the intervals from the 2 subsets (left and right) that are not contained in another interval. Now just query if the column subset (x..y) contains in interval that contains y1, y2 (from the query in the statement). If this stands true, that means there exists a column not covered by a rook.

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

      A -- why? Just use hashes to compare cyclic shifts in .

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

        and why does it work?

        • »
          »
          »
          »
          »
          9 лет назад, # ^ |
            Проголосовать: нравится -21 Проголосовать: не нравится
          • sorry my english *

          Лёх, в смысле, почему? Задача: выбрать мининмальный цикл сдвиг из каких-то. Решение: перебираем все, какие надо, из них за O(nlogn) хешами берём минимум. А какие надо, определяется по min баланса на отрезке и разнице балансов концов.

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

            Вопрос о том, почему хеши не отгребут?

            И, судя по обсуждению в ВК и твоей посылке, ответ — ни почему, отгребут

            Хотя можно использовать двойные, да (об этом сразу я не подумал)

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

              Ну блин =))) Я же на дорешке сразу перепослал с простым модулем и ОК получил. Всё норм.

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

                Да, про то, что хеши можно написать нормально, я иногда забываю:), не люблю я их:)

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

                  А ты тогда не пиши, ты копипасть! =) StrComparator

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

                  Да, надо бы позаполнять библиотечку, только руки не доходят.

                  Только я теперь не копипащу, а генерю:)

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

                (Russian version in edit history)

                This might be a silly thing to ask, but… how can you be sure that, when hashing a whole million of bits (and that’s only because we’re limited to parentheses here; we could easily have had letters) to just 64 bits, there won’t be any collisions that break the solution in one way or another?

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

                  Let hash-function is seem random. Then . Where N — number of substrings to hash. If N ≤ 108, it's small enough (10 - 3).

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

                  So basically, you just hope for the best?

                  Well, that’s one way to do it. I just thought it was customary to always expect the worst case in competitive programming.

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

                  So basically, you just hope for the best?

                  Yes, I always hope. Always, when I use randomized algorithms. Like polynomial-hashing, like Miller-Rabin, like Schwartz–Zippel

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

                  Not to belittle your main point, but Miller–Rabin is deterministic for finite input given the right (constant) set of bases. 2, 7 and 61 cover all 32-bit integers, while 2, 325, 9375, 28178, 450775, 9780504 and 1795265022 cover all 64-bit integers, or so the Internet told me back when I copied these lists.

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

                  You may modify Miller-Rabin to be more determenistic, but basically Miller-Rabin says "let consider any random number!". And it gets error with probability <= 1/4.

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

                  The thing is, using the (finite and constant) sets I posted instead of random numbers gives a probability of error of exactly 0, making the test completely and utterly deterministic and reliable.

                  There’s also a version that gives the same result for arbitrary input ranges with the assumption that the generalized Riemann hypothesis is true, but it’s asymptotically slower: it’s basically “try all potential witnesses up to ; the number is a guaranteed prime iff all of them fail”.

                  Of course, if you want an arbitrary input range and can’t accept the factor, the classical Miller–Rabin is probabilistic as you said.

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

                  Note that, when the probability of failure in your algorithm is less than, say, 10 - 15, it is less than the probability of a hardware failure. So, when solving a problem, it's customary to discard that probability, as it's customary to discard the probability of hardware failure when running your implementation.

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

Wow, I totally misread the fact that you have to use 2 different bills only in problem E, and only realized that 10 minutes before the end. Needless to say, time penalty when submitting at 01:57 is rough :D

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

    Yes, I missed that as well, because that completely crucial info was hidden in one inconspicious sentence xd

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

What is the Hacking Case Of Problem E? TLE Case Or Any Critical Input Pls Suggest Me

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

    I think that was TLE case!!

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

    We made one array overflow hack

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

    n*n*k*q fails because 5000*5000*20*20 is roughly 10^10. I was surprised to see the number of div1 coders who submitted using this approach.

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

      Can you explain the solution?

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

        Here is my solution:

        for amount from 1 to k (to find the smallest amount of bills needed):
          for i from 1 to n:
            either it will use amount * denom[i]
            or partially (try splitting amount into 2 numbers, then binary-search)
        

        Hope it helps!

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

Hm, my solution of A: STL magic to get all rotations where the answer is minimum (btw trivial minimum), then suffix array to sort rotations. It fails on pretest 11...

UPD: found it, I computed the costs of rotations incorrectly.

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

    According to the results, your solution on pretest 11 is actually lexicographically smaller than the judge output, so you must have produced an invalid solution somehow. My solution is the same algorithm but it passes pretest 11 if that matters.

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

    Check the balance of first 113 chars

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

    You can find the costs in O(N), and then the minimum lexicographic rotation for a minimum cost set in O(N) also, it is way more elegant than suffix arrays.

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

      Can you please explain in more detail how to do second part in O(N)?

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

        O(N) suffix array? :D

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

        Sure, there is an algorithm which finds the smallest rotation of a string in O(N). Explaining it would take long, so I will leave code here in C++ : The string S has length n and it is 0-indexed .

        mi=0; p=1; l=0;
        while(p<n&&(mi+l+1<n))
        {
            if(S[mi+l]==S[(p+l)%n])
                l++;
            else
            if(S[mi+l]<S[(p+l)%n])
            {
                p=p+l+1; l=0;
            }
            else
            if(S[mi+l]>S[(p+l)%n])
            {
                mi=max(mi+l+1,p);
                p=mi+1;
                l=0;
            }
        }

        After this, the minimum rotation will begin at position mi. As you can see, we asume that the solution begins on position mi, and we compare it with p on the course.In our problem, we set mi as the first position where the rotation is good, and p as the second one; and in the algorithm we advance with p to the next good rotation, because we need the minimum lexicographic rotation only for some of the rotations calculated earlier.

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

          I explained why this works at http://www.quora.com/How-does-the-minimum-expression-algorithm-by-Zhou-Yuan-work/answer/Fernando-Fonseca-2. Using this on this problem didn't come to mind during the contest though, well thought.

          Also, nice template :P Hilfe! Das Monstrum im mir wird explodieren!

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

            Thanks for the link! Why is the algorithm called "minimum expression"?

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

              To be completely honest, I had never heard of that algorithm before answering the question, so I just copied the name from the title.

              I can theorize on why, though: if you're working on a problem in which all rotations of a string are equivalent (this would happen, for example, if you were considering a circular necklace or people sitting on a circular table), then all rotations of the string would actually be different expressions for the same arrangement. The minimum expression would then be the lexicographically smallest way to describe a certain arrangement, and it can be used to associate each arrangement with a unique representation.

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

            Thanks! But why does the loop in your last, succinct version stop at i+k==len? Shouldn’t it wrap around to check the whole rotation? Similarly, why does the loop in the code Kira96 posted stop at mi+l+1==n?

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

              Actually, if mi+l==n, I should stop because that letter isn't within the range [0,n-1]. Oops, my bad :).

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

really bad problem statements :(. long, hard to understand and with constraints hidden among the story

what is the point of long statements?

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

There's a solution running on pretest 4. Because of that, the systest is stuck at 100%.

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

Problem D used a very simple greedy solution. It was so simple that I couldn't believe its correctness (as there were few people solved it). I spent much time to hack it, but failed. So I decided to code it.

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

When will the problems be available in the Problemset?

UPD: They're now available.

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

I lost about 30 minutes for problem E because I didn't read condition "at most two distinct denominations", and finally failed system tests because of runtime error :(

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

BTW, after we saw the problems , don't you think that the problems are not that hard to prevent div2 from participating ?

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

    And also in this div1 contest easiest problem from VK Cup wasn't used (problems B-F from VK Cup were presented there, but in shuffled order and with minor changes in some of the tasks); so I guess div2 contest can be obtained from div1 round by changing problem A (which was used as F at VK Cup) to problem A from VK Cup and changing problem B to it's simpler version from VK Cup (there was no <=n/2 lying limitation).

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

My code for problem B failed system test 22. Could someone tell me what's the problem?

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

How to solve problem E, please somebody who can explain his idea?

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

    "and the bills may be of at most two distinct denominations." now i understand why everybody say too easy, damn it!!

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

      This is so ridiculous. :[

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

        Well, there are other parts that you might miss there. I have missed K <= 20 and have implemented extended Euclidian algorithm to solve it for arbitrary K. It was O(Q * N^2 * log (2*10^8)) and after getting hacked with TLE optimized down to O(Q * N^2), but it still wasn't enough to avoid TLE.

        So, side question. Is there anything better than that if K can be also large?

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

Why are previously accepted solutions for 529C - Rooks and Rectangles getting Runtime error on test 31?

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

about problem C : in input say n<=100000 ; but in test 31 n=3e5 !!! :(

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

In problem B: trying every height in the input to be the maximum height gets WA on test 18, while trying all heights from 1 to 1000 gets AC!

WA: 10389037

AC: 10389163

At least one person won't lie on the ground, so why my solution is not getting the correct answer by trying all the given heights?

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

Something unusual:

Why do these submissions not get TLE?

10386307, 10388227, 10386918

The problem statement currently clearly says "time limit per test: 2 seconds".

Submissions during the contest seem to have timed out at 3000ms, so maybe the time limit was changed? Also, anta must have a lot of courage to stick with a solution running in 2963ms on pretests!

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

wow , i just found out how slow reading with stream's are on problem C:

over 2 sec's (TLE) with streams

450 ms with scanf

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

Am i wrong or the problem A was so easy for only 10 people sent it in the contest? As you can see I am purple guy, and I had the basic ideia during the contest in 5~10 minutes and solve it after contest without help. I think i did not solve it correctly, because nobody was passing it. So, I thought i could not solve it. Was that the hardest problem in the contest?

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

    Honestly, I found C a bit harder than A, but A had such little submissions because : 1.Nlog^2(N) for SA might not get passed. 2.It was a lot to code.