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

Автор dzy493941464, 12 лет назад, перевод, По-русски

Всем привет! Codeforces Round #FF(255) начнется совсем скоро! Раунд будет проходить в обоих дивизионах, приглашаем всех принять участие!

Главным героем задач этого раунда снова становится DZY! Вы все уже знаете, что DZY интересуется очень многими вещами. В этот раз у DZY есть много интересных задач. Задачи будут проще, чем в прошлый раз, тем не менее ваша помощь потребуется. В награду за помощь DZY подарит вам рейтинг.

Спасибо Gerald, который помогал нам в подготовке раунда. Также спасибо MikeMirzayanov, благодаря которому существуют существует Codeforces.

Задачи раунда готовили: jcvb, jiry_2 и я. Это наш первый раунд Codeforces :)

Ждем вас на контесте, DZY очень нужна ваша помощь!

Желаем удачи и удовольствия от решения задач! :)

UPD

Разбалловка для первого дивизиона: 500-1500-1500-2000-2500.

Разбалловка для второго дивизиона: 500-1000-1500-2500-2500.

Условия задач Codeforces Round #FF (Div. 2)
  • Проголосовать: нравится
  • +198
  • Проголосовать: не нравится

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

easier than the problems in last round — sounds great! BTW, in last round every problem was solved by >=10 contestants, hard to believe that this time problems will be even easier. But if they do — it will be nice:)

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

Hope this time problems could be more interesting than the last ones :).

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

if i remember correctly, in the last round most of the problems were about you.
maybe now it is time for some revenge. ;) we will see.

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

Chinese(Hangzhou Xuejun High School) round again!

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

Опять китайський раунд? все, я ливаю...

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

FF :) С юбилеем!

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

Early annovzbbsbsnxnnsnd...

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

Seem that, DZY himself is the problem setter this time.

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

Last time I didn't really enjoy DZY problems... Wish this time better than last time...

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

Why Codeforces Round #FF(255) but not Codeforces Round #255 ?

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

I like he also brings us many interesting problems and I like more which are easier than the problems in last round

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

This is the first contest dzy493941464 hold. Hope him success in this contest

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

I think Div 1 E will be 3000...

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

Crap. It's DZY again. I'm scared.

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

You should also mention about the unusual time of this round so that no one might miss it.

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

easy problems are not good, because the rating matters how fast you solve the problems :/

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

    Easier problems are good, because it matters how many problems you solve and not just how fast you can solve them.

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

      First of all sequence of problems should be without large gaps in dufficulty, so a bit stronger contestant may easier overcome weaker one by number of problems and not just by time — we are competing in solving first of all, not in typing speed, right? Otherwise there is no difference — "500 guys solved 3 problems, 20 guys solved 4+" and "500 guys solved 1 problem, 20 guys solved 2+" are almost same scenarios for me.

      As I mentioned in russian topic after last round, that round was pretty good — every problem was solved by 10+ users, nobody solved all 5 problems, number of AC is decreasing from A to E...

      And I compared that round with "standard 1/5/50/500 round" (talking about number of users with first 5/4/3/2 problems solved). In my personal opinion rounds like previous one are way more interesting than "standard 1/5/50/500".

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

a math round?

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

Hello, ladies and gentlemen! It's DZY's show time! :)

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

As it is Ramadan, is it possible to shift the contest at least 30min ? Current Contest starting time is same as the iftar time here in Bangladesh.

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

why is Codeforces Round "#FF" ? 0xFF = 255, maybe the Round #FF is the next of Round #254 ?

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

That sounds Great! I hope it can be successful.

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

I can't participate to this contest because of the flight to IOI place.

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

What does fuking FF mean?

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

I think the next contest will be "Codeforces Round #100" as: FF + 1 = 100 (base 16)

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

hmm, really odd email i received from Codeforces.

I'm glad to invite you to take part in Codeforces Round FF (Div. 1 and Div. 2). Actually it will be two separate rounds "Codeforces Round #254 (Div. 1 Only)" and "Codeforces Round #254 (Div. 2 Only)".

firstly, there's no # before FF, which is usually always seen in all CF rounds.
secondly, "Codeforces Round #254"? seriously?

PS: take this as constructive criticism so that next time these mistakes can be avoided.

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

Oh my god... this is last round...

Next contest don't will... overflow byte..

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

Hello from Taiwan.

thanks for our last chance to practice before IOI. Good luck and have fun everyone.

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

Please prepare a readable and thorough editorial. Thank you :)

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

For me, entering this round means not watching the World Cup Final. it's difficult trade-off...

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

Soccer Maniacs wouldn't attend this round :v

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

Score distribution is a bit strange for me. 500 from Div1 used to be equal to 1500 from Div2, I guess, 1000-to2000, and so on. Today task C from div2 costs 2000, but task A in div1 (which used to be the same with Cdiv2) costs only 500. But, according to the logic of previous rounds score distribution, it must be 1000.

I understand, that authors know better, which one is correct, but isn't it a mistake?

UPD: Changed to 1500

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

1500 (B div2)? Все очень плохо

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

After do contest I will watch FIFA World Cup between Argentina and Germany

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

div2 B shows 1000 in the contest.

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

I...don't understand why Div 2 Problem A begins with "DZY has a hash table..." Do the problem writers actually expect Div 2 contestants know what a hash table is? (Div 2 contestants that can solve Problem D/E are okay, but how about beginning contestants that can barely solve Problem A?)

Personally, this is approximately how I'd phrase it:

DZY has p buckets, one of which is colored red. Each bucket can hold one ball. For the i-th ball, DZY starts with facing the red bucket and turns clockwise for xi buckets before putting the ball into the bucket in front of him. However, sometimes DZY cannot put a ball because the bucket he's facing already holds a ball. Output the number of the first ball that DZY cannot put.

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

    There are alternative solutions for this problem without hashtable,We can do Vector Add numbers and Vector Add module for every number and every time , you must check , Are this number contains in this vector or not :) Hope it help

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

      I know there is a solution without hash table. (When I finished reading, I already got the solution using simple arrays.) However, the problem here lies on the wording. It feels like you need to know what hash table is (even if you eventually don't use it) just to understand the problem. My view is that problem wording should be as simple as possible, even if the solution can be terribly complicated.

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

        Here's a hopefully comparable analogy:

        You are given points on the plane, forming a polygon. It is guaranteed that the polygon has a dihedral group of order 8. (Test case has no picture of the polygon whatsoever.)

        You will most likely say "WTF" on the last sentence. Compare:

        You are given points on the plane, forming a polygon. It is guaranteed that the polygon will be symmetric like a square: when you rotate the figure by 90, 180, or 270 degrees, the polygon remains the same, and when you reflect the figure along some line, the polygon also remains the same. (Test case has a picture of the polygon, explaining the symmetries.)

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

    that's just a bluff :P

    we can see high number of accepted submission for that :)

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

Неужели в C div. 1 решение корневой декомпозицией по запросам было нежелательным? :(

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

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

Полцарства тому, кто скажет, что здесь не так: 7085342

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

In problem A (Div1), are we allowed to change the numbers to zero? E.g. what is the answer for sequence (1 1 2 3) — 3 or 4?

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

Кто-нибудь сдал в D(div1) n^3 log k ?

упс, это вообще-то дофига получается:(

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

I tried hacking BhulJa div2 C which should have given garbage value for N=1 but it returned correct answer I don't know why .

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

Hi, Can anyone please explain your approach of Div1 B / Div2 D ?

Thanks.

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

    The mathematical proofs are maybe a little bit long but pretty intuitive. Obs.: 1) It doesn't matter in which order you do the operations. 2) You can let 0<=l<=k be the number of line operations (and take the best variant at the end). 3) For a fixed l, use 2 priority queues to calculate the results for l and k-l elements picked both for rows and columns. 4) Combine the result for l (on rows) with the result for k-l (on columns) with a little bit of maths. 5) Don't forget about long long.

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

      Is this equivalent to the greed solution? In my solution, at each step, I would select the best row or column (the one with greatest sum) using two PQ. I don't know if greedy works (couldn't prove it), but it really feels like it should work. No idea why WA. :(

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

        I got WA on pretest 4 doing the same thing!

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

        It doesn't work.

        2 3 6 1 1 1 1 1 1 1

        Sometimes you don't want to select the best row in order not to start getting negative sums.

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

        It doesn't work. Consider 1 3 10 1 1 1 1

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

        i'm just guessing here, but did u consider that every row's sum reduces by p during every column operation (and vice-versa)?

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

          Yes JuanMata. It looks like Greedy is a bad idea. (Greedy is almost always a bad idea. I will try to remember that next time) :(

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

            Actually there is a huge greedy part in the solution. You just have to be sure when you are using greedy algorithm, you should have proof or something (maybe not very rigorous).

            The greedy part here is that if you look at choosing rows and columns separately, when it's about rows, it's always right to choose the largest row. Same hold for columns. Than it's easy to solve this 2 problems separately and merge them. You're gonna need to brute force how many rows you choose.

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

              Forgot proof of a greedy strategy. Choosing largest row is optimal, because: (1) The order of rows chosen doesn't affect the final score; (2) Assume in the optimal solution the largest row was not chosen. Then, swap the largest row with any other chosen row. Obviously the score will increase, hence contradicting the optimality of a solution.

              You can also prove that you can choose just rows at first and then choose only columns. I guess the details are already posted (at least in the editorial), so I won't go further into details.

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

        No, its not equivalent. You solve the problem for only rows and only columns separately, and then choose how many rows and how many columns to use based on these results. The key observation is that each row operation reduces the results of each following column operation by p, and vice versa, so the total score is ScoreRows+ScoreColumns-NumRowOperations*NumColumnOperations*p, regardless of the order in which you do the row and column operations — this is because for each pair of RowOperation and ColumnOperation whichever comes first reduces the result of the other one by p, and there is a total of NumRowOperations*NumColumnOperations pairs.

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

Can someone help me to understand why my solution for div 2 problem E is too slow to pass test 9?

I use segment tree + lazy updates.

Thanks.

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

Что-то у вас не так со сложностью. Неужели нормальных несложных задач нету? Две С, да и то одна из них, как D. Да и А была скорее В. Итого, выкинуть самую сложную задачу и добавить одну, которая была бы проще всех остальных — было бы самое то.

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

In Problem C, DZY Loves Sequences, I made a minor mistake of initialising a variable to 0 instead of 1. So naturally, it gave WA. But after correcting the mistake and trying to re-submit, it says that The exact code has already been submitted, and I could not submit it. How is it possible?

P.S. I had saved the file.

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

I am being hacked at 17:57:37, The Codeforces send me the Announcement at 18:59:25, and I am very surprised about this (so bad)

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

Sorry if this is a stupid question, but how long does it usually take before the ratings are updated?

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

    It's not stupid! I've been asking this question from myself since i've been taking contests! It never has a fixed time. It usually takes half an hour before the system testing part and half an hour (or even more) after that for rating updates :)

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

Это неловкое чувство, когда на одном тесте поломал половину сабмитов в комнате, а в конце контеста решил проверить работает ли моя прога на этом тесте и выясняется что НЕТ!

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

my idea for C div 2 is split the sequence if it's not an increasing subsequence, and join with the neighbour if possible (change 1 number from sequence left or right, and made strictly increasing seq)

here is my submission http://mirror.codeforces.com/contest/447/submission/7087449

any other ideas or my idea wrong ?

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

Задачи будут проще, чем в прошлый раз, тем не менее ваша помощь потребуется.

Задачи будут проще

проще

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

can anybody explain me how to solve div-2 D . thnx

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

I encounter a strange issue during the contest. my ID became duplicate and every time I refresh my submission page its contents were different !

and when I locked my problem C ! (notice to contest time running!)

and some seconds later :

I deleted all my codeforces' cookies during the contest but still nothing were changed!

what was the problem MikeMirzayanov?

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

why is system testing unusually slow today?

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

I will never believe in Chinese authors' word about easiness of the contest, specially of dzy493941464 :(

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

Who's idea to make C and B same points. Oh, well done really, Solvers of B is 6 times more then C :

64 * 6 ~ 343

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

why most of div2 C submissions failed system tests ?

can anyone give me the tricky test case which most contestants couldn't pass ?

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

DZY definitely starts to please me.

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

three people scored 1134 points, and they took the (joint) 254th position.
this unfortunately means that nobody could take the 255th position in the 255th CF round. :(

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

I got tle on test case 9 in div2-Q5. I used segment tree. was that too tight for the time bounds?

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

Why DIV2 problem C's test 41: 6 7 2 3 1 4 5 answer is 4?

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

Nice contest :D

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

Excuse me. But why my rating hasn't updated? I found that everyone's rating has been calculated but mine hasn't done.

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

You can view country wise standings here. Send your hugs or bugs here.

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

Did anyone try to solve Div2 C using two pointers?

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

Is the contest unrated for Div.1??? The rating of Div.2 was updated, but Div.1 not.

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

What asymptotics should be in Div2-D? I had O(pk) (I hope) and got TL. Now I wonder is it too bad or just Python?

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

i'm hoping that the ratings of Div-1 will be updated before the World Cup final starts.

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

Why DIV2 C test 27 1 1 2 3 4 answer is 5 (not 4)?

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

DZY очень нужна ваша помощь!

Поможем, нам не сложно))

Раунд окончен. Поздравляем победителей.
Див. 1:
1. vepifanov
2. subscriber
3. RAVEman

Див. 2:
1. llllllllllll
2. geniucos

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

А див. 1 правильно рейтинг пересчитали? а то у меня до контеста было 1701, я занял 457 место из 701 и рейтинг упал на 2))

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

Can someone tell me why this submission is giving Runtime Error?

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

Хмм... Как быстро найдёте разницу? :)

7094727 7094719

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

In question C. DZY Loves Sequences

Shouldn't the answer of (testcase #27) 5 1 1 2 3 4 be 4? Value of ai can never be less than 1.

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

I don't see why we need all the complicated logic in the editorial for Fibonacci problem. We can simply precompute the first 300000 values linearly and store them in an array.