MikeMirzayanov's blog

By MikeMirzayanov, 10 years ago, translation, In English

Hello!

VK Cup 2015 — Round 1 (unofficial online mirror, Div. 1 only) — is public unofficial replay of Round 1. It means that if you didn't take part in VK Cup (for example, you are not Russian-speaking), decided to cancel further participation in VK Cup or didn't pass a Qualification you can take part in VK Cup 2015 — Round 1 (unofficial online mirror, Div. 1 only). You should be in Div. 1 to take part in it.

Mostly it will be typical round with regular Codeforces rules. Persons (not teams) will take part in it. The problems will be in English and in Russian. It will be hacks and rating will be updated after it. It will be used recently implemented smoother dynamic problem scores with 250 points steps. You can read about it here.

There were many not Russian-speaking teams in VK Cup Qualifications. I encourage these teams to respect the position of the organizers and not to take part in official Round 1. Please, take part in VK Cup 2015 — Round 1 (unofficial online mirror, Div. 1 only).

Wish you good luck!

  • Vote: I like it
  • +139
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
  Vote: I like it +5 Vote: I do not like it

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?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +21 Vote: I do not like it

    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.

»
10 years ago, # |
  Vote: I like it +110 Vote: I do not like it

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.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +122 Vote: I do not like it

    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.

  • »
    »
    10 years ago, # ^ |
    Rev. 2   Vote: I like it -48 Vote: I do not like it

    So good luck.

»
10 years ago, # |
  Vote: I like it +38 Vote: I do not like it

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?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

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

    Maybe there just aren't easy problems.

    • »
      »
      »
      10 years ago, # ^ |
      Rev. 2   Vote: I like it +5 Vote: I do not like it

      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.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +47 Vote: I do not like it

    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.

»
10 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Atleast, out of competition for Div 2?

»
10 years ago, # |
  Vote: I like it +45 Vote: I do not like it

Unofficial But Rated : WOW.

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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?

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You will be able to take part in it virtually after contest ends.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Sorry , I meant while the VK cup goes on , can i participate in some other gym contest . Because vk cup is not allowed for me .

»
10 years ago, # |
  Vote: I like it -10 Vote: I do not like it

We do not have a heart? We want VK Cup

»
10 years ago, # |
  Vote: I like it -16 Vote: I do not like it

We do not have a heart? We want VK Cup

»
10 years ago, # |
  Vote: I like it +95 Vote: I do not like it

Are the problems sorted in order of difficulty?

»
10 years ago, # |
  Vote: I like it +7 Vote: I do not like it

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.....

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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?

»
10 years ago, # |
  Vote: I like it +2 Vote: I do not like it

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

»
10 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Delayed 15 mins :_(

»
10 years ago, # |
  Vote: I like it +21 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Do you lose it otherwise? :D

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +19 Vote: I do not like it

    How much of it would you donate to codeforces? We could make a deal...

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      As I have already lost, I let you have 100% of it. So, my friend wants to know when he will get his money?

»
10 years ago, # |
Rev. 2   Vote: I like it +67 Vote: I do not like it

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.

»
10 years ago, # |
  Vote: I like it +26 Vote: I do not like it

Well, no cheaters because of delay?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +20 Vote: I do not like it

    Actually, E was the easiest problem.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it +21 Vote: I do not like it

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

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      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...

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Where is rooms?

»
10 years ago, # |
  Vote: I like it -6 Vote: I do not like it

rated?

»
10 years ago, # |
  Vote: I like it +19 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +75 Vote: I do not like it

    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!

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you tell your solution of problem C?

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it +3 Vote: I do not like it

        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).

      • »
        »
        »
        »
        10 years ago, # ^ |
        Rev. 3   Vote: I like it +13 Vote: I do not like it

        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.

        • »
          »
          »
          »
          »
          10 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          This should be simpler:

          1. Check the rows
          2. Rotate the board and flip queries
          3. Check the rows
        • »
          »
          »
          »
          »
          10 years ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          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?

          • »
            »
            »
            »
            »
            »
            10 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            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.

            • »
              »
              »
              »
              »
              »
              »
              10 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              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?

              • »
                »
                »
                »
                »
                »
                »
                »
                10 years ago, # ^ |
                  Vote: I like it +12 Vote: I do not like it

                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.

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it +15 Vote: I do not like it

        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.

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

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

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        and why does it work?

        • »
          »
          »
          »
          »
          10 years ago, # ^ |
            Vote: I like it -21 Vote: I do not like it
          • sorry my english *

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

          • »
            »
            »
            »
            »
            »
            10 years ago, # ^ |
            Rev. 3   Vote: I like it -17 Vote: I do not like it

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

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

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

            • »
              »
              »
              »
              »
              »
              »
              10 years ago, # ^ |
                Vote: I like it -25 Vote: I do not like it

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

              • »
                »
                »
                »
                »
                »
                »
                »
                10 years ago, # ^ |
                  Vote: I like it -25 Vote: I do not like it

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

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                    Vote: I like it -24 Vote: I do not like it

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

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                    Vote: I like it -24 Vote: I do not like it

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

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

              • »
                »
                »
                »
                »
                »
                »
                »
                10 years ago, # ^ |
                Rev. 2   Vote: I like it 0 Vote: I do not like it

                (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?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

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

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                    Vote: I like it -8 Vote: I do not like it

                  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.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                    Vote: I like it +24 Vote: I do not like it

                  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

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                  Rev. 2   Vote: I like it +5 Vote: I do not like it

                  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.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  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.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                  Rev. 3   Vote: I like it -8 Vote: I do not like it

                  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.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  10 years ago, # ^ |
                    Vote: I like it +41 Vote: I do not like it

                  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.

»
10 years ago, # |
  Vote: I like it +32 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

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

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    I think that was TLE case!!

  • »
    »
    10 years ago, # ^ |
    Rev. 2   Vote: I like it +3 Vote: I do not like it

    We made one array overflow hack

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Can you explain the solution?

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it +4 Vote: I do not like it

        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!

»
10 years ago, # |
Rev. 2   Vote: I like it +10 Vote: I do not like it

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.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    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.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Check the balance of first 113 chars

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

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

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it +13 Vote: I do not like it

        O(N) suffix array? :D

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        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.

        • »
          »
          »
          »
          »
          10 years ago, # ^ |
            Vote: I like it +10 Vote: I do not like it

          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!

          • »
            »
            »
            »
            »
            »
            10 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

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

            • »
              »
              »
              »
              »
              »
              »
              10 years ago, # ^ |
              Rev. 2   Vote: I like it +5 Vote: I do not like it

              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.

          • »
            »
            »
            »
            »
            »
            10 years ago, # ^ |
            Rev. 2   Vote: I like it 0 Vote: I do not like it

            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?

            • »
              »
              »
              »
              »
              »
              »
              10 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

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

»
10 years ago, # |
Rev. 2   Vote: I like it -25 Vote: I do not like it

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

what is the point of long statements?

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
10 years ago, # |
  Vote: I like it +31 Vote: I do not like it

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.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Also those low constrains made me to be not sure about greedy solution

»
10 years ago, # |
Rev. 2   Vote: I like it +68 Vote: I do not like it

When will the problems be available in the Problemset?

UPD: They're now available.

»
10 years ago, # |
  Vote: I like it +27 Vote: I do not like it

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 :(

»
10 years ago, # |
  Vote: I like it +43 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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).

»
10 years ago, # |
  Vote: I like it -9 Vote: I do not like it

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

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      This is so ridiculous. :[

      • »
        »
        »
        »
        10 years ago, # ^ |
        Rev. 2   Vote: I like it +3 Vote: I do not like it

        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?

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Why are previously accepted solutions for 529C - Ладьи и прямоугольники getting Runtime error on test 31?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    n is 300000 :-" !!

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      The problem statement still says 1 ≤ n, m ≤ 100 000, 1 ≤ k, q ≤ 200 000. Also why was that case added after the contest? Really annoying. :/

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Fixed.

»
10 years ago, # |
  Vote: I like it +5 Vote: I do not like it

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

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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?

  • »
    »
    10 years ago, # ^ |
    Rev. 2   Vote: I like it +11 Vote: I do not like it

    At least one person does not lie on the ground, true, but it isn't guaranteed that the highest person is someone standing up.

    For example,

    2

    5 10

    11 8

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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!

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    You should use cin.sync_with_stdio(false);

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      mhm thanks for the tip that worked fine , i got AC but still 1000 ms compared to 450;

      btw ,how does this work, why it has halved the runntime.

      • »
        »
        »
        »
        10 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I'm not so sure how this works, but maybe this post helps: link

»
10 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

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?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.