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

Автор numbertheorist17, история, 11 лет назад, По-английски

Hello, Codeforces!

I am happy to announce Codeforces Round #331 (Div. 2)! The round will be held on November 15th at 7:35 MSK. Div. 1 users can participate out of contest.

The problem set was prepared by me (Girishvar Venkat) and jaina (Jeffrey Zhang). I sincerely thank GlebsHP (Gleb Evstropov) for helping with the preparations of the contest. I also thank thesilione (Bili Sun) for testing this round.

The hero for this round will be Wilbur the pig, after my good friend wilbs43 (Wilbur Li).

Scoring will be 500-1000-1500-2250-2500.

Hope you enjoy this round and wish you high rating!

UPD: Contest is over. Here is a link to editorial: Editorial.

UPD2: Congratulations to all the winners! Results:

Div. 1:

  1. tourist

  2. DBradac

  3. ztxz16

  4. V--o_o--V

  5. waterfalls

Div. 2:

  1. Ichiban

  2. Antoniuk

  3. thjchph4trjnh

  4. halyavin

  5. Rafiki53

Hope you all enjoyed this contest! Thanks for participating!

UPD3: Ratings updated.

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

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

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

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

It's very rare that scoring distribution isn't "announced later".

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

lots of number theory problems ?!?! :)

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

I wonder why it's 19:35 but not 19:30.

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

Is round going to be interesting ? Your color says the contest not going to be interesting. Always people with color like your's make contest hard and uninteresing.

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

as your username it seems we are going to have number theory problems

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

I know I'm gonna get many downvotes for this comment, but I really hope that problems would be based more on complex algorithms rather than math.

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

this contest will be rated! yeeee! ^_^

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

I thought I saw Xellos comment in this thread, but now it's disappear. Is that a bug?

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

I think its going to be a math contest (The handle of Girishvar Venkat :|) Why not changing the name from CodeForces 2 AlgebraForces??

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

Wish I can have a good night and a high rating.

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

Hope for maths!

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

just a usual delay !!!

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

Mathforces instead of codeforces ...

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

Really liked the problems! Haven't had such a nice round for a while

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

Can anyone explain C?

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

    I've come up with the following idea:

    As you can see, we can associate a list of vertices with an index of an array (or map, if you will).

    Step 1: create the vertex queues

    Vertices on the diagonal (0, 0), (1, 1), (2, 2), (3, 3), (4, 4), ... are all map to 0. That means, we can store these particular vertices under the key 0 in some container. I store them like that:

    map< vector< pair<int, int> > > vertex_queues;
    vertex_queues[0].push_back( make_pair(1, 1) );
    vertex_queues[0].push_back( make_pair(3, 3) );
    vertex_queues[0].push_back( make_pair(2, 2) );
    ...
    

    vertex_queues[0] now stores the vertices unordered. So, we need to sort them so that we can use them later.

    Step 2: construct the answer by taking the vertices from the vertex queues in the right order

    The last step is building the answer. We go through the array w[n] from left to right and take the first element from the vertex queue with the index w[i]. So, the i'th vertex must be the one we've just taken from the queue. One by one, we extract all the vertices from the vertex queues in the order dictated by the array w[n].

    If there are no elements in the w[i]'th vertex queue, the anser is NO. If, lastly, we look though all the vertices in the array that we've constructed and find that the current vertex is less than the previous one, the answer is also NO.

    Otherwise, we've build the perfectly valid array of vertices which is the solution to the problem :)

    14288949 — with map
    14289137 — with vector

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

    First you should sort points by their y-x then for each w[i] from last to first set the point with biggest x and y!

    now we should check that does this greedy algorithm make a aesthetically pleasant! sort points and then for each (x,y) we calculate the mp[ (x,y) ] the maximum index of every point like x' and y' that 0<=x'<=x and 0<=y'<=y in the answer! and we update it with mp[ (x-1,y) ] and mp[ (x,y-1) ] , if one of them was bigger than index of (x,y) print No!

    now we know answer for each w[i] and it's aesthetically pleasant!

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

А RuntimeError на кф уже не учитывают? Вот Код человека и тест который я вбил. Мне сообщило что у него выводит -1 и все ок. Скажите мне факт которого я не знаю, чтобы я больше не делал глупых взломов.

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

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

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

Editorial before finish time ??

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

hacked 5 people in problem B in my first hacking attempt on codeforces thanks to this

2

-1000000000 1000000000

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

The character "Wilbur" may just as well have not been in the problem statements. All it did was add clutter.

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

    But reading the problem through the clutter is a part of the problem. If you would be said like "given array, find sum of absolute differences between i and i+1 for i from 0 to N-1" then it wouldn't be a contest.

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

      The clutter I'm talking about is the crap about Wilbur, not the actual problem itself. The problem could have been simply:

      You are given an array a of size n which initially consists of all zeroes. In one step, you may choose any index i and either add or subtract 1 to all elements from ai to an. Your goal is to end up with the given array b.

      What is the minimum number of steps required to reach your goal?

      Simple and concise. Add a story behind it if you'd like, but don't do it just for the sake of doing it.

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

      It's a trade-off. The problems on Project Euler don't have stories, but that doesn't make them any more boring for me. Personally I actually prefer that approach, but I'm also fine with some characters and a small story to make the problems more fun.

      The thing with Codeforces is that the English is very difficult to read and often has typos or grammatical mistakes. And sometimes there's just so much stuff. See this older problem for example, would you enjoy reading that when there's pressure to solve the problem in 2-3 minutes? http://codeforces.me/problemset/problem/48/A

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

I loved the contest — keep it up! Thanks numbertheorist17 and GlebsHP

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

Самый лучший контест!

Без непредвиденных задержек, с разбором сразу же после окончания, и систесты тоже быстро начались! Рейтинг тоже быстро обновили.

Побольше бы таких :)

Кстати, между окончанием контеста и окончанием систестов прошло менее 20 минут :)

Большое спасибо numbertheorist17!

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

This comment was written before final results. I didn't know that they will be same

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

Problem E was nice but pretty hard to implement in a short time,it would have been better if the input was a tree instead of matrix(because it wouldn't have cycles and make things easier)

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

Super fast system testing this time

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

Почему в задаче А тест

3
1 1
2 2
5 5

некорректен?

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

    эти точки не являются вершинами прямоугольника положительной площади, у которого стороны параллельны осям.

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

      Но ведь любая точка является вершиной какого-то прямоугольника положительной площади, более того, таких прямоугольников бесконечно много.

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

        Они должны быть вершинами одного прямоугольника.

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

        Они вместе должны образовывать прямоугольник, а не каждая точка по отдельности. Прямоугольника с вашими вершинами не существует.

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

          Покажите, где это написано в описании задачи.

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

            Он ввёл координатные оси и так выбрал прямоугольник, чтобы его стороны были параллельны этим осям. Конечно, площадь этого прямоугольника была положительна. Все четыре вершины запланированного бассейна были записаны у Вилбура на бумажке, пока не пришёл его вредный друг и не стёр некоторые вершины.

            Вам во входных данных даются вершины, не стёртые его другом.

            Гарантируется, что точки яляются вершинами какого-то прямоугольника положительной площади, со сторонами параллельными осям координат.

            ___ Либо я не понимаю, как вы стали синим, либо вы очень любите придираться к словам не по делу.

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

              Вилбур мог ошибиться при записывании координат на бумажку, не зря же он сиеновый на кодфорсе. :)

              Фраза "Гарантируется, что точки яляются вершинами какого-то прямоугольника положительной площади, со сторонами параллельными осям координат." в прямоугольной системе координат бессмысленна. Очень странно видеть ее в контесте, в котором есть задача на математическое ожидание.

              А про то, как я стал синим, — ребята, не стоит вскрывать эту тему.

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

                Всё-таки, с точки зрения русского языка, фраза "точки являются вершинами прямоугольника" говорит как раз о том, что точек много, а прямоугольник один. В противном случае правильно было бы сказать "Гарантируется, что точки являются вершинами каких-то прямоугольников..." и, действительно, не имела бы смысла.

»
11 лет назад, скрыть # |
← Rev. 4  
Проголосовать: нравится +98 Проголосовать: не нравится

> when you hack someone and then fail on your own hack during systest

EDIT: The funny thing is, if I hardcode the answer to my hack test, I get AC. Meaning if I didn't hack, maybe I wouldn't have failed systest... worst feeling ever :'(

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

I don't know how to deal with the problem D? Is this a dp problem?

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

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

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

What a bad day! I did my computer component principle homework about how cpu work the whole day and didn't finish it. That made me not think strictly in round and get a bad rank. I'm so sad. :(

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

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

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

why the main test 18 in problem A gives wrong answer but when i run this program in my ide it give me correct answer 0

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

Обнаружил баг/фичу: когда сначала во взломе выбираешь в ручном режите файл, случайно, потом переходишь на генерируемый крепишь код жмешь отправить пишеет странные ошибки типа выберите файл Потратил пару минут чтобы вкурить и перегрузить Спасибо

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

tourist is BACK for a contest! :D

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

Why this code getting TLE? Its complexity is O(n^2) :( I really don't have any idea why.

14287878

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

Weak Test cases in C.
8 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 0 1 2 -1 0 1 -1 -2
Solutions giving YES followed by wrong sequence gets AC.
Correct Answer: NO
AC Buggy code: 14287550

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

We always see in codeforces, the output is judged by special judge. that means if the output is 1 then if you print 1.000 there is no problem. Even sometimes Lower case uppercase does not matter. Today I wrote problem A with double variable got WA. For output printing the problem says, "Print the area of the initial rectangle if it could be uniquely determined by the points remaining. Otherwise, print  - 1." There is no instruction that the output should be integer. But it causes me wrong answer and finally I have a devastating contest. 14274647

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

Could someone explain me how this solution (http://codeforces.me/contest/596/submission/14278463) passed all tests?!

P.S.: during the contest I tried to hack it several times using tests like

but without any success :(

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

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

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

Very Weak Data Set for problem C ... http://codeforces.me/contest/596/submission/14281582 3 6 3 7 0 6 2 -3 -7 -4 This code cant pass this input, but passed system test.

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

Why I got verdict skipped? 14275850, 14282184 and 14273892. This is my first time to solve 3 problems in a contest!

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

tourist was the first to solve each problem , amazing !!

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

numbertheorist17

Weak Test cases in Question: C. input: 15 0 0 1 1 2 2 0 1 1 2 2 3 0 2 1 3 0 3 0 4 1 0 2 1 2 0 3 1 3 0 0 1 -1 2 0 -2 3 1 -1 -3 2 -2 1 4 0

output: should be NO [also verified using [user:tourist] sol'n :p]

Two users in top5(div2 rankings) got it accepted...even though their output is wrong.
Rank1: Ichiban and Rank5: Rafiki53 :p

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

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

Who else thinks D was more doable than C?

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

    During the contest I got intimidated by the number of people who solved D and didn't give it much thought. Later I tried to solve it and found it easier than C either, it's a straight foward DP.

    Actually I think the hardest task on C was understand the english translation, the problem itself wasn't hard.

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

I Love Judge!!!???