Автор scott_wu, 8 лет назад, По-английски

Hello everyone! The first round of the 8VC Venture Cup will be held on Saturday, February 13th at 12:35PM EST. ecnerwala and I are the problem setters. We want to thank GlebsHP for his help in preparing the contest, Delinur for translating the problems, and MikeMirzayanov for creating the Codeforces platform

The contest is for competitors in both divisions and contains seven problems. The scoring distribution is as follows:

500 — 750 — 1000 — 1500 — 2000 — 2500 — 3000

The contest will be slightly longer than usual — two and a half hours. The top 200 contestants will advance to the final round, and the top 20 local finishers will be invited to Woodside, CA to compete onsite. Good luck!

UPD: System testing is now over. Congratulations to the top contestants:

  1. Petr
  2. jqdai0815
  3. ilyakor
  4. bmerry
  5. Errichto

The top 200 contestants will advance to the final round in two weeks. Congratulations!

The editorial can be found here.

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

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

Разбалловка объявлена за 3 часа до контеста. Остановите Землю, я сойду.

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

I hope This contest will be very interesting and there are many hacks. Good luck every one !!!

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

    How do you know?

    And by the way being among the top 100 while having solved only 3 problems (because of hacks) is not a good thing.

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

      being among the top 100 while having solved only 3 problems (because of hacks) is not a good thing. but being among the top 20 while having solved only 3 problems (because of hacks) is a very good thing. :D

      I think nothing is not good in being in the top 100, if you solve problems or make successful hacks both are allowed in CF rounds. If you did not cheat then you deserve this place.

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

        I was about to say among the top 20 but then changed it to 100 when I remembered that there're gonna be Div. 1 participants :D

        And by the way I am proud of my rank in that contest, but I'm not proud of my performance. A participant who solved the forth problem would have deserved my rank much better.

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

        Hacks are good when you open the source code of another person and try to find a bug (which is really challenging and who makes it successfully deserves a higher rank), not when you find a test case that's not included in the pretests and keep refreshing the room for new participants to hack with that same test.

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

The score gaps of the first three problems is close => Must solve fast.

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

tourist is joining, how high will his rating go?

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

Hope that all legendary masters will compete. Very big prizes!!!

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

Is it rated?

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

Good luck everybody.

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

What does top 20 local finishers mean? Is there also an onsite version of this round?

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

    Local means people who can get to San-Francisco by their own (organizers do not cover transportation expenses)

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

    People who marked "I would like to compete onsite in finals" during a registration. Organizers don't pay for travel so likely only people living close to Woodside want to attend onsite finals. Thus, "local finishers".

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

Перевод на русский будет?

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

It feels nice, inspiring and much exciting to compete with the Div 1 participants.

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

Oh money money.

Wwonder who will be the first , and takes the money.

1st place 2500$

tourist will still rich ))

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

Sorry I'm asking this here.If someone registers for a contest and sees the problems but makes no submission will their rating be changed ?

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

    No, rating change only happens after you make a submission.

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

      Yayyyy :)))

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

      I personally think the current system should be changed — anyone who sees problems should be automatically counted. There seem to be a lot of people who register but decide not to submit anything after they find out they can't solve enough problems to boost their rating. About 5500 registered, but only about 3000 are in standings. There are probably some people who couldn't just make it to the contest, but there are also probably a lot who just look at the problems and go away after finding them too difficult.

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

        Unfortunately in your case there will be a lot of twice account guy in CF, every cheater can register another account to see whether problems are difficult or not. As consequence we will have inflation of rating(all fake account will fall in rating). Anyway, cheaters gonna cheat.

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

          That is true — there is no perfect way to block cheating. However, a lot more people will hesitate when they realize they are doing something that explicitly breaks the rules (IIRC registering and not submitting due to problem difficulty is not breaking the rules).

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

"Without looking, they hand their balls to Harry"

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

Okay, for E, am I right that I only need 1,2,3 or 4 elements? I couldn't handle the 4-case :(

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

    If I'm right, you never need an even number of elements, but you might need an odd number of elements bigger than 4. Example:

    5 0 0 0 13 13

    Optimal solution is to take all 5 elements.

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

      Oh, thanks! :)

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

      Why odd number of elements is enough? The problem kind of pushes towards this conclusion but I could not see why is it true.

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

        I'm not going to post the whole algebra here, but basically, suppose you have an optimal subset with an even number of elements, the middle ones being A1 and A2. Now consider the same subset without A2, and you'll see the simple skewedness can only increase by removing that element, which means the original subset wasn't actually optimal.

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

    NO 6 2 2 2 3 12 12

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

How to hack C? QAQ

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

difficulty : A<B<C<D<<<<<<<<<<<<<<<<E,F<<<<<<<<<G

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

How to solve F?

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

    Sort by value and then dp[open_intervals][cost_so_far]. When we move from i to i+1 then cost_so_far changes to cost_so_far + open_intervals * (t[i+1]-t[i]).

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

      Can you please define Open Intervals ?

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

        The number of groups (intervals) for which we have already processed at least one element but there is at least one non-processed element. In other words, the first element of a group (interval) is not greater than i, and the last element is greater than i.

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

      Another possible solution (with much worse complexity, yet fast enough to pass) :

      We are interested in having difference between sum of all "left endpoints" and all "right endpoints" at most k. Let's calculate dp[open_intervals][current_difference]. When considering new element, it can either start new interval (and increase current sum of "left endpoints") or join some existing interval; in both cases it can either close interval (and increase sum of "right endpoints") or keep it open.

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

        I did this and got TLE :(

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

        It sounds like you're describing the same solution. The "current difference" can be big, but that can be solved by indexing using "current_difference-open_intervals*current_number"; if you write down how it changes the rules for opening/closing, you arrive at Errichto's formula.

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

          It's easy to see that it isn't the same solution because the complexities are different. The solution which I_love_Tanya_Romanova described with your optimization (which is what I implemented) has (n * max(ai) * k) states, while Errichto's doesn't depend on the actual values of the integers in the array. Of course, as max(ai) = 500 in this problem, it's clearly good enough.

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

For Problem F, can someone explain me why the answer at the second test is 13 and not 15 ? :/

EDIT : ok I got it.

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

I guess, the statement of problem C is not describe clearly.

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

Первый раз у меня вырубили свет, когда все засылали В, второй раз — когда все перешли к С. Очень обидно, а ведь я в кое-то веке стал синим — видимо, не надолго. Именно эта небольшая разница в баллах и играет роль в соревнованиях, когда очень многие решают одинаковое количество задач. К слову, что может быть не так с 4-м претестом в D? UPD: как раз-таки та задача, которую я писал с лету после того, как потерял кучу времени, не прошла из-за дурной ошибки — массив на один элемент меньше нужного.

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

C had weak pretests / made for hacks :D I wish i read "alphabetically" earlier in B :( Cost me 3 WA

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

So, can anyone please explain why the result of 2nd sample case in task F is 13?

I've manually calced it on paper like 10 times in different ways and keep getting 15.

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

I'm sure that there are many people confusing when they read "so no two students’ towers may contain the same number of blocks" in problem C. While it should be no two towers have the same height.

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

    I also got confused when the problem said that the students were stacking the blocks lengthwise.

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

    There is a clear distinction between pieces and blocks in the statement. IMHO no confusion.

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

I'm really upset. I can't pass the Examples while I'm working on F. Finally I found a bug but there are only 16 seconds left. I was too exciting to submit my code properly. (I had a mistake when copying my program and it got CE.)

upd:Now I feel much better because I got TLE on test 11. (⊙o⊙)

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

Could anyone explain test 8 for E?

I have completely no idea :(

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

In E, I quickly found out that we need 2 intervals (in the array sorted left to right), where the middle element/s have to be in the first one and the second one touches the right end. I couldn't move from that point for over an hour...

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

    I saw several passed solutions that looks like this: make ternary search in one part, in another, make binary search in another place, and check another 100 places. I don't think that it is solution supposed by authors.

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

    Let's assume that the median is fixed. We need to find optimal k (that is, the length of the suffix). Key observation: if we consider "skewness" as a function of k, it's convex and ternary search is applicable to it(can be verified by writing down all sums and seeing what happens if we increase k by one).

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

      I see. I briefly considered ternary search as one of my guesses, but didn't try to prove con[vex/cave]ity.

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

      All I could guess from looking at examples, was that it was a monotonous function, so I coded binary search and it failed pretest 8, guess I looked at poor examples..

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

      I got WA7 with that solution. Is there any problems with floating values?

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

      How do you handle equal values of mean with ternary search?

      e.g. 0 0 0 0 1 2 2 2 2

      If you fix median = 1, then there're lots of equal value of mean for different values of k

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

        If the mean doesn't change, it doesn't matter which one you pick :D

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

          That's a small example. It could be something like:

          0 1 1 1 1 10 99 100 100 100 100

          If you fix median = 10, the mean changes at some point, but your ternary search doesn't find it.

          Zlobober's comment answered my question though.

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

            change if (f2(mid, k) < f2(mid+1, k)) { r = mid; } else l = mid; to if (f2(mid, k) < f2(mid+1, k)) { r = mid; } else l = mid + 1; you will get ac :)

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

            My ternary search doesn't find anything because I don't have any ternary search :D

            In fact, I said the same thing as Zlobober. It doesn't matter which value you pick out of an interval of identical ones. Look at ternary search as binary search for a point where the difference between consecutive values of the given function (a prerequisite of ternary search is that it's monotonous) changes sign from  > 0 to  ≤ 0; it's more obvious that way.

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

        Actually, as you take elements from right to left from both sides, there may be no more than one segment of equal values for the function we are willing to maximize. And this segment corresponds to the maximum value of a function as it is concave.

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

      Could you prove why it is convex? I spent a while trying to prove this during contest, but my thought were too messy, so I took a risk and submitted it without a proof and as it turned out, that was a good decision, however I am still not convinced why this works.

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

        Not sure how to prove it's convex, but it's somewhat easy to see it's bitonic, which is good enough.

        What happens when we increase size by two? We move from S/n to (S+a+b)/(n+2). As we know, the latter lies between S/n and (a+b)/2. (a+b)/2 continuously decreases (since we move to the left). So while (a+b)/2 is greater than the current mean, we will get an increase, and when it starts being less, we will always get a decrease.

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

          And it seems to me that it's not actually convex. If we have something like

          aaa...aaabbb...bbbmxxx...xxxyyy...yyy

          (number of bs=number of ys<<number of as=number of xs)

          then we'll have two almost flat segments.

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

            Can you show an actual example? I'm quite satisfied with an explanation I provided below.

            UPD: got it, my explanation below is an explanation of bitonicity. Of course the slope of a line joining the origin and the point on the convex polygon doesn't have to be convex itself.

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

              import matplotlib.pyplot as plt
              %matplotlib inline
              n1 = 100
              n2 = 10
              vals = [0.0] * n1 + [1.0] * n2 + [2.0] + [3.0] * n1 + [4.0] * n2
              def Mean(count):
                  all = vals[n1 + n2 - count : n1 + n2 + 1] + vals[len(vals) - count:]
                  return sum(all) / len(all)
              plt.plot(range(n1 + n2 + 1), [Mean(x) for x in range(n1 + n2 + 1)])
              
        • »
          »
          »
          »
          »
          8 лет назад, # ^ |
          Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

          Ahhh, right, thanks :). I had similar thoughts during contest, but couldn't join them to get that proof, however if I'm not mistaken there's still a flaw in your proof (or something that doesn't sound as you wanted to) -> "current mean always increases" (which is obviously just a silly mistake since you wanted to show it's bitonic :). That mean increases up to point where that (a+b)/2 becomes smaller than mean. After it, mean also decreases, but slower than (a+b)/2 (it will be larger than previous value of (a+b)/2), so (a+b)/2 will stay smaller than mean, so after that point mean is decreasing.

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

            Yeah, the first version was incorrect, but I've updated my comment as if it never happened :)

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

        It can be seen as a slope of a line joining the origin and the point whose x-coordinate is number of taken integers and y-coordinate is their sum. As you increase the number of taken integers, the differences between consecutive y's are non-increasing (since the numbers that we add are non-increasing), so it looks like a concave polygon in positive quadrant that we draw a tangent to from an origin.

        UPD: this is not an explanation why the function we are willing to maximize is convex, but it is a proof that it is bitonic (i. e. first increases, then decreases).

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

My B passed pretests during the contest. Why did it fail test 1 during system tests?

Edit: I found a typo that makes it fail pretest 1. Yet it somehow passed all pretests the first go around. It was merely a typo and I fixed it here. I would have quickly fixed it during the contests if it told me that pretest 1 failed.

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

My bad

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

207 T_T

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

Is me only one who thinks that problem C should be more elaborated :/. I read PS thrice before i figured out what it meant :(

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

Btw, it is me, or today codeforces was running like 5 times faster than usual? Literally no page load longer than 1 second, and pretests was really fast too.

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

Conclusion : US Round = Math Round

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

It's 4:23 a.m. in China, And I think I must go to bed to have a rest. So Tired QwQ

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

Can any one please tell me why this submission to D fails in 6th test 16007337

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

Failed due to integer overflow on problem D :(. Was sitting for so long not understanding why my code was failing :(

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

Auto comment: topic has been updated by scott_wu (previous revision, new revision, compare).

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

Who thinks B was harder than C ?

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

    I didn't even understand C.

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

    B is easier as algorithm, but harder in terms of implementation accuracy (a lot of possible cases).

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

      No, you are wrong. You can take a look to my solution — there is not a lot of different cases. And algorithm is even easier as yours :) 16007975 The only thing because of I have not solved it is 200 instead of 201( I had lost a lot of time and was very busy, so, done really stupid mistake.

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

      I've found a short and easy solution: 15992405 without many ifs and elses

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

The top 200 contestants will advance to the final round in two weeks.

Currently, there are 2 people in 200th place (me and Nikitosh), so what will it be? XD

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

Memory limit exceeded in F, though the array is int[][][] dp = new int[n + 1][n + 2][K + 1], which is 201*202*1001*4 ~ 160Mb, while memory limit is 256Mb. 16003432

Running max test (n=200, k=1000) in "Custom Invocation" shows 309828 KB of memory usage.

Running test with (n=184, k=1000) shows only 128488 KB.

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

Thanks for the contest. I'm interested in editorial

Reminds me that I must work more on proper technical execution, I spent too much time finding "i" instead of "1" bugs. Also I knew that numbers in D must be sorted, I thought I sorted them and did not understand why pretest fail.. Only a few minutes after the end of contest I realized how close to success I was.

A. Is a nice example of "read constrains" problem. Surely naive solution is not the fastest, but it is fast enough.

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

Identical participant output results in different checker's comment:

http://mirror.codeforces.com/contest/626/submission/16002527

participants output: 3 0 475712 999999

checker output: wrong answer jury found better answer: expected simple skewness 262143/3, found simple skewness 48575/48575

http://mirror.codeforces.com/contest/626/submission/16008372

participants output: 3 0 475712 999999

checker output: wrong answer jury found better answer: expected simple skewness 262143/3, found simple skewness 48575/3

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

    Also seems to give Denial of Judgement when I try to print some stuff to debug: [submission:http://mirror.codeforces.com/contest/626/submission/16009256]

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

      Yes, checker crashed if you output some large number first. That happens. No one was affected during the contest anyway.

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

      Checker is OK now, submission was rejudged.

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

    We noticed bug in checker's comment during the contest and fixed it. So the first submission was made before the bug was fixed.

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

How to solve D?

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

    Store all the possible differences in a frequency array . such that freq[i]= number of pairs such that their difference =i . eg if array is 1 2 10 freq[1]=1(2-1) freq[8]=1(10-2) freq[9]=1(10-1). Now make a cumulative array such that A[i]= number of pairs such that their difference is greater than or equal to i. Now for value for every pair of difference value find the number of pairs which have value greater than this pair . i.e if Winning points were a in first round and b in second round you need number of pairs such that winning round is greater than a+b(which is A[a+b+1]. multiply all the case and divide by (nc2)^3 Code

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

Worst contest for me ! I submitted the same code which got WA (first submission) second time thinking i got WA on my corrected code :'( and submitting the corrected code got AC . trying not to cry

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

Failed systests in 2 problems because of overflow

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

Are there any other contests before the final round? Or there will be 2 weeks without any contests...

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

Only one more Legendary grandmaster till all in the top rated be Legendary grandmaster. ;)

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

B: once you have many cards of the same color, it doesn't matter if you have 4 or 100000. You get the same result. This means you could implement the most naive bruteforce you can think of — and it will be fast enough — after you truncate the input to max 4 cards of each color.

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

can someone please tell me why this solution for problem D gives TLE 16009986

let m be max element , so my solution runs in O(m^2) and m < 5000 I think 25m operation with 2 seconds isn't too much

thanx :)

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

    Your solution complexity is O(m^2 log m^2) as you insert elements in a map; which should run in logarithmic time with a large constant factor — as you're inserting ~25M elements there. Try reducing this by removing the map and using arrays directly for storage and indexing.

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

      thanks for correcting me ,yes it is O(m^2 log m^2) .

      fixed and got AC .

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

No editorials?

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

Can somebody tell me what principle/algorithm is used in this solution for 626C - Block Towers 15992435, when taking a large segment from 0 to INF and then narrowing down to the correct answer? Looks like a binary search, but why does this work here?

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

    It is binary search! :D

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

    We are using binary search on possible answer. We know that if x is possible that all values greater than x are possible. Similarly, if x is not possible, all values less than x are not possible. So take min=0 and max=INF and calculate mid. If mid is possible then our answer will be greater than or equal to mid else less than mid. Iterate till only one possible answer is left which will be the answer.

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

 Why I've passed pretest ? The pretest just have one testcase? :))

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

    Why I get TLE ? on 2 RG ?

    for submission ? 16006497

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

    Same thing happened to me. Except for test case 1. So I passed pretests but managed to fail test 1, which was just the sample test case. I'm pretty salty that the first sample case wasn't in the pretests.

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

    I think they made a clarification that test 2 is not equal to pretest 2, and gave the data for test 2.

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

      I will clarify my question: Why my solution gets TLE on codeforces while working fine on my machine.

      E.g.: Time: 2000 ms, memory: 7920 KB Verdict: TIME_LIMIT_EXCEEDED Input

      2 RB

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

Иногда можно и топ 6 победителей написать... так, на всякий случай.

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

I really need some advice about programming. Yesterday I did problem C, and I was quite sure about the solution, only to find the failed system test. When I checked, what I did wrong was missing a small, simple but crucial character "=". How do good coders avoid such silly mistake?

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

    Practice, practice, practice,

    test your code before you submit (try and make up some test cases so you make sure all of your code in all cases have been run, except if you're very confident),

    double check your code before you submit.

    Those 3 things I guess. I also still struggle with quite a few things like that as I'm new as well. I failed D because I hadn't used long long but the rest was just fine :(. It's sad, I know, I think we all know that feeling being programmers haha.

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

I wonder how much rating gain Bus will get if he did not purposely lowered his point o.O

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

Could somebody tell me why my solution to D fails on test 2? On my machine it works perfectly, but on custom invocation it fails, even if I manually set br = 2, total = 27? My solution: http://mirror.codeforces.com/contest/626/submission/16013981

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

deleted

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

Anything known about top 20 local finishers?