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

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

Всем привет!

В эти дни в Москве проходит вторая Международная олимпиада мегаполисов — международное соревнование для школьников из крупнейших городов и столиц мира, одной из дисциплин которого является информатика. Над турами по информатике имели удовольствие работать члены члены жюри, приглашённые из Санкт-Петербурга, Минска, Алма-Аты, а также Московская методическая комиссия, известная вам по Московской командной олимпиаде, Открытой олимпиаде школьников по программированию и Московской олимпиаде для 6-9 классов (раунды 327, 342, 345, 376, 401).

Мы очень признательны MikeMirzayanov за разработку системы Polygon, которая делает возможным и очень удобным одновременный перевод условий на большое количество языков, и, по давней дружбе с замечательной платформой Codeforces, мы проводим параллельный рейтинговый Div. 1 + Div. 2 раунд на задачах соревнования.

Раунд состоится 6 сентября в 15:55 по Москве и продлится два часа. В каждом дивизионе будет предложено по 5 задач, разбалловка будет объявлена позднее.

В составе жюри олимпиады: andrewzta, GlebsHP, Endagorion, meshanya, Chmel_Tolstiy, Zlobober, Елена Андреева и Бахыт Маткаримов. Задачи олимпиады разрабатывали timgaripov, mingaleg, halin.george, vintage_Vlad_Makeev, malcolm, LHiC под руководством вашего покорного слуги.

Выбрать задачи для раунда помогал координатор Codeforces KAN.

Всем удачи и высокого рейтинга!

PS Мы просим всех, кто участвует или знает задачи с основного соревнования, воздержаться от участия в раунде и публичного обсуждения задач, в противном случае вы можете быть дисквалифицированы.

Поздравляем победителей!

В div. 1 это:

  1. Um_nik
  2. fateice
  3. KADR
  4. dotorya
  5. FallDream

В div. 2 это:

  1. jiangIy
  2. xolm
  3. yxqk
  4. lixolas
  5. Rawnd

Опубликован разбор. Всем спасибо за участие!

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

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

Note that round ends 5 minutes before CSAcademy Round #47, so you can participate in both of them if you want.

==============

Обратите внимание, что раунд заканчивается за 5 минут до CSAcademy Round #47, и вы можете успеть поучаствовать в обоих раундах, если хотите.

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

Why this round called extraordinary? :)

Capture

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

3 contests in 3 days fantastic :)

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

Is the round rated?

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

I hope there won't be a geometry problem :D

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

    Would be interesting to see the dependency between rating and not loving geometry. I'm pretty sure that yellow+ people don't care, while all the greens hate it.

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

      Graphical Illustration :)

      Forgive my paint skills.

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

      why you have to be mean to him ?

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

      I would beg to differ. Geometry is rather hated all around the world by vast majority of people. The thing is, green struggle to check whether n points are collinear and reds struggle with computing area of sum of pacmans by integrating border of regions with holes with border consisting of different arcs and segments :P. However I like geometry. I think that maybe geo problems are not as appealing as others but I have just simply forced myself to like it because somebody in our team had to do this :P. And dealing with all stupid corner cases and precision issues is never exciting.

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

      I really hates geometry, so I'll be a great counterexample for that sentence :)

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

      I don't get it that how a particular type of problems should be or can be hated. I mean, there are so many topics there, and if one is not comfortable with some topics or faces difficulties in solving problems regarding those, he/she shouldn't dislike/hate it. Every topic has its own beauty. I personally like geometry even though I am not so good at it. And I suck at DP. Does that mean I'd say "Why so many DP problems?" or "This round sucks because 2 DP problems appeared!"??? No, I wouldn't say that. I know most people are not that comfortable with geometry problems. So what? That doesn't make it bad. And as Swistakk said, Red coders face trouble with really tough geometry problems and Blue/Green/Cyan/Grey coders face trouble with simple problems. So, it depends on one's skill. And it can also happen that a very good geometry(or any other particular topic) problem solver is Green while a red coder is not so good with that topic. It can happen sometimes, maybe rarely. But personally I think, everyone should have basic knowledge of every topic. One should know how to check if n points are collinear and other basic geometry stuffs, and one should also know the basics of every topic that may appear in a standard programming contest.

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

      No, I hate geometry.

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

      not really. Thanks to those geometry problems my color changed from green to light blue. I love geometry problems :)

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

Good luck and high ratings for everybody

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

I just find there is only 2016 International Olympiad of Metropolises, day 1 in CF Gym

Would you please put "2016 International Olympiad of Metropolises, day 2" to Gym

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

    I just wanted to solve the tasks of the last year, so decided to add them to polygon to test. And then decided to add to the gym also for the others. But I got bored and didn't uploaded the second day :)

    I found the tests on the official site, so you can find them and upload to polygon, if you want.

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

That's my last chance to become an expert till tomorrow.

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

Алма-Ата переименовали в Алматы в 1993 году.

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

May the force be with all....

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

For every contest, score distribution is announced just before the contest starts. Just for my curiosity, I want to know, what's the reason behind this?

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

The start time of this contest is perfect. thank you ♂ sir

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

Hope problems are better than previous contest.

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

we need more CF rounds!!!

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

where can i find soloution for problems? i really need to cheat

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

Score distribution?

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

WTFFFFFFFFF? WHY DIV1D is very easy??? I hope it will not faill

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

How to solve Div 2 C? I tried to find a recurrence relation for 1 hour before giving up.

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

How to solve div2 D/div1 B ?

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

Is there nlogn scanline solution for div1C? I solved it with merge sort tree in O(6 * n * logn * logn), but I'm quite concerned about TL

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

How to solve C?

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

Is the there a hack test for DPpos, money, where money is current money in card?

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

Too many data structure!

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

My current rating=2017, so this is good bye 2017 for me. Also goodbye div 1 :(

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

Binary search + segment tree (query min prefix) solve D1 D in any contrains for cost, bonus.

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

Time limit of Div.1 C is too tight, I kept getting TLE on pretest 4 with N log N complexity! It's not fair!

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

    Well, i passed pretests with O(nlognlogn) solution, so there may be a problem in your implemention

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

      I think there's nothing wrong with my implemention, maybe I have a large contant. That leads to 9 * N * log N.

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

        I also have a constant O(6nlognlogn)

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

          O(6 * N * log N * log N) passed? That's crazy. Well, perhaps I was wrong. I'll check my program later.

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

          I have corrected my answer. It seems that my submission during the contest was right, but I picked the wrong data structure. The problem can be solved with binary search tree by making all queries offline, but I used persistent segment tree. That brought me a huge constant, I think I could pass within 3 seconds. Thanks for listening to my problem.

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

            Good day to you,

            well I managed to get AC with PST (in ~1.6) so it shall be no problem.

            Your PST seemed to run even faster then mine.

            Moreover if I changed the limits:

            #define MAXN	500005
            #define MAXP	18200095
            

            the TLE turned into WA (but hope I didn't broke anything by this)

            Good Luck & Have Nice Day!

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

              I'm sorry but I'm quite sure my PST method runs much slower than my BIT method (about twice slower), and my BIT method passed in 1.2s. That program might be my last submission during the contest, I had not finished debugging it, so it went WA. Check my previous submissions during the contest, I was saying about that. Thanks a lot for listening to me and wish you a nice day (Exactly evening here in China).

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

                Oh yes, I didn't want to doubt about this statement (imho PST has very big "constant" even though the complexity is nice — due to memory).

                I just wanted to propose that the mistake might have been somewhere else — anyway seems you have tried to increase constants too (with TLE) so I'm slightly confused :O :P [maybe other submission]

                Well so enjoy your evening then ^_^

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

my reaction while pretests is running

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

Finding a typo in my code for problem D after the contest ended. However it still passed the pretests. Pretests for D are too weak. :(

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

A minute of silence for a contestant who made the following "genius" piece of code...

int n; //Size of array P
PersistentIT t;

ll Solve(int l, int r, int d, int u) {
    ...
    int n = (r-l+1);
    int nu = t.query(l, r, u+1, n);
    ...
}

I can't believe that it took me nearly 1.5 hours to solve C (with I should be able to do in less than 15 minutes, given that I had the Persistent IT template). I'm so terrible at not creating bug T_T

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

Div2C solvable with segment tree?

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

How to solve div2C ?

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

Does anybody have solution to D, which is clearly correct? I wrote something and I've stresstested it, so I'm not in this group :P

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

    I think so.

    Let's do binary search on answer. It is clear that we will spend bonuses on last 1000s and last 2000s (it can be not a suffix, for example 2000 2000 ... 2000 (9 times) 1000 2000 1000, it is optimal to spend bonuses on two 1000 only). But if we omit two 1000s or take two 1000s after omitting 2000 (going from right to left) we can change it (two 1000 for one 2000, take the variant which is more on the right). So we have only O(1) possible variants, each of them can be checked in O(n) time.

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

    You can show that there is an optimal solution that pays for the first k using cash, and the last n-k using rewards card, except for at most one exception which costs 1000.

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

how to slove div2 B....

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

Is div1C merge sort tree? I found bug in my solution but still not sure if it's the right way

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

I wrote a '+' instead of a '-' in a 200-lines code on C and I found it 1 minute after contest ended :( FML

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

when i locked my solution and solution is hacked

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

how to solve div2/C .

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

I misread the statement of Div2.D that there will be flights between the cities. Then I went to an intricate solution using ternary search + visual vertexes + shortest path on a reconstructed graph and a transposed one. Failed to finish the implementation.

Maybe I should improve my reading. The previous round is ruined for I misdeemed that given points A,B,C can be exchanged.

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

I can't debug 1B out... Goodbye div1...

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

Anyone with probably correct solution to Div1 E?

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

    First, you can compute the Minkowski sum of the velocity vectors. This gives a convex polygon with 2k sides that describes achievable speeds. Then, to compute the answer for a exhibition i, center the polygon on the exhibition, scale it depending on the number of days ti, and count the number of factories inside it.

    To compute the number of factories inside it, split the polygon into 2k triangles, and sum the results for each triangle. The hard part is then to compute the number of points inside a triangle.

    Actually, there are only 2k different kinds of triangles if we ignore translation and scaling, and for a single kind of triangle, we can compute all values in O(n log n).

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

      How do you compute in O(n log n) for a triangle?

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

        We can assume that the triangle is (0, 0), (0, 1), (1, 0) by changing the base. We have points (xi, yi), and queries (ai, bi), (ai, bi + ti), (ai + ti, bi). With a single sweep along x + y, it is possible to compute values in O(n log^2 n). With a sweep along x + y, and a sweep along x, I think it is possible to reduce it to O(n log n) by computing #(x + y < ai + bi + ti) - #(x + y < ai + bi + ti, x < ai) - #(x + y < ai + bi + ti, y < bi) + #(x < ai, y < bi). (I will try to draw something to explain it).

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

          It is correct, but kind of an overkill.

          You may express the original polygon as a sum of 2k half-infinite trapezoids, some of which are added and some are substracted. A number of points in a trapezoid of fixed shape may be found in O(n log n).

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

            Sorry, I don't see how you would decompose the polygon into the trapezoids. Could you explain?

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

              Shoot a downwards ray from each vertex of the polygon. Each side of the polygon along with its two rays forms a half-infinite trapezoid

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

                Okay. But in what way is this easier than a triangle, with one base of length zero?

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

                  Well with similar trapezoids you can transform them all into rectangles. Then counting the number of points inside a rectangle can be done with a single sweep + fenwick tree. I think doing this with triangles is a lot more complicated.

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

                What kind of transformation makes it a rectangle?

                Also, couldn't some of the regions become triangular when you draw the downward lines?

                Sorry for the questions, just have never seen this technique before.

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

                  Perhaps calling it a trapezoid is confusing? The trapezoids have no bottom edge, as the downwards rays extend to -infinity. The idea is that for each side of the polygon, we want to sum all the points underneath it. Then to get the sum of points inside the polygon, we add up the points below the upper hull and subtract away the points below the lower hull.

                  All the trapezoids are two vertical lines and then a sloped line. Half-infinite trapezoids with the same slope can all be transformed into half-infinite rectangles with a change of basis. So if the side of the polygon is the vector (a, b), the transformation (x, y) -> (x, ay-bx) works (it makes the sloped side horizontal).

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

                Oh, okay. I thought the "trapezoids" were real 2D trapezoids, which cannot be affine transformed into rectangles, but it all makes sense with infinite trapezoid. (I guess a triangle is a sum/difference of two or three trapezoids, then.)

                Thanks for taking the time to explain.

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

Why doesn't system testing start right after the contest ends?

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

I solved Div1 D like this and hacked. Is there any counterexample?

1) Try buying first k with money only 2) Try buying first k with money only, except the last "1000" of them

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

How can i know for which input was my DIV2B hacked?

Thank you

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

Today I learned: if s is a set, lower_bound(s.begin(),s.end(),v) is not guaranteed to be logarithmic. Use s.lower_bound(v).

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

Mike Bought a nitro for the systest :D

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

Bugatti CF Systems

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

can someone tell me what is wrong with my code 30156568 for 2D(1B)?

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

Can anyone tell me if there is a way to make 30158579 faster? In each query I use 6 calls to 2D Fenwick Tree, so the complexity is O(Q log^2 N).

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

    Maybe compressing the coordinates and not using a unnordered_map.

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

    Good day to you,

    Firstly, such 2DFenwick also has "hash-map-complexity" which can't be neglected.

    Well there were some other greedy solution for this problem anyway to keep problem, simply replace fenwick, you can:

    Use some segment-structure, whic could answer: Number of numbers on "[L → R]" lesser/equal then "X" (if you want rectangle [L,X]→[R,Y]), you can ask [L,R,Y]-[L,R,X-1].

    First structure, which could do it in "clear" O(logN^2) is merge-sort tree (segment tree with sorted number in each node. You use it as classical segment tree with binary searches)

    Second — probably faster — way is Persistent Segment Tree (you can simply add "1s" in order of their heights). This works in O(log(N))

    Hope it is understandable.

    In case you are interested in anything (or it was not undestandable), don't hesitate to ask.

    Good Luck & Hope it helped,

    Have nice day!

    ~/Morass

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

    Instead of storing a pair in unordered_map, try using an array of unordered_maps. Although 6 calls to 2D Fenwick tree seems unlikely to pass given the constraints and time limit.

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

    I managed to make a 2D Fenwick Tree pass using the query logic of another submission:

    http://mirror.codeforces.com/contest/853/submission/30166694 my 2D Fenwick Tree

    http://mirror.codeforces.com/contest/853/submission/30149861 original submission for the logic

    Turns out you can calculate everything using only 4 queries.

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

What did the "rated extraordinary" mean, for this contest?

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

i guess the contest it unrated :/

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

i guess the contest is unrated :/

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

Why using arrays here took 826 ms while the same code using vectors here took 264 ms.

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

so is it rated?

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

How does Div2C greedy approach work? We can create a bipartite graph with the left vertices as initial times and the right vertices as final times and an edge with the weight of the cost. It is a classic assignment problem. What condition in this question reduces the problem complexity making the greedy solution optimal?

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

Weak testcases ( in Pretest ) in DIV2-D. No integer overflow upto 75 testcases. Got overflow in testcase 76 due to int declaration :(

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

Can someone tell me why this does not get a TLE ?

http://mirror.codeforces.com/contest/854/submission/30162063

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

what is the case 83 in div2.d ? any special case or overflow reasons ?

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

jiangIy ( first in div 2 ) . First contest encrypted submission. 25623055

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

I was in doubt if I would attend to a class or do the contest. It seems that it was worth taking the contest =D Thanks for the congratulations!