Автор BledDest, история, 6 лет назад, По-русски

Привет, Codeforces!

23 ноября в 18:05 по Москве начнётся Educational Codeforces Round 33.

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

В качестве эксперимента мы решили сделать раунд рейтинговым для Div. 2. Соревнование будет проводиться по немного расширенным правилам ACM ICPC. После окончания раунда будет период времени длительностью в один день, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 6 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной готовили Михаил awoo Пикляев и Владимир vovuh Петров.

Удачи в раунде! Успешных решений!

UPD: Разбор задач.

Также у меня есть сообщение от наших партнёров, Harbour.Space University:

Be sure to join these courses to sharpen your programming and data analysis skills:

Combinatorics and graphs with Sergey Nikolenko, Researcher, Steklov Mathematical Institute at. St. Petersburg. He is a computer scientist with vast experience in machine learning and data analysis, algorithms design and analysis, theoretical computer science, and algebra.

Algorithms and Data Structures with Edith Elkind, Professor University of Oxford, Department of Computer Science. She researches game theory and the computation of social choices. She looks at the decisions involved in multi-agent systems such as auctions, elections and co-operative games.

Big Data Analysis: Mapreduce, Spark, BigTable/HBase, Distributed Data with Pavel Klemenkov and Alexey Dral. With HDFS, MapReduce, Spark, and NoSQL, students will master and sharpen their knowledge in basic technologies of the modern Big Data landscape.

Parallel and Distributed + High Performance Computing with Dalvan Griebler. The name says it all. Learn how to run your programs faster.

List of all courses:

27.11.17 — 15.12.17 — Image and Video Analysis with Archontis Giannakidis

27.11.17 — 15.12.17 — Linear Algebra with Archontis Giannakidis

08.01.18 — 26.01.18 — Text Mining & Translation with Sergey Nikolenko

08.01.18 — 26.01.18 — Combinatorics and graphs with Sergey Nikolenko

29.01.18 — 16.02.18 — Security analysis of networked objects with Yaroslav Rabovolyuk

19.02.18 — 09.03.18 — Security Operations Center and Cyber Threat Hunting with Sergey Soldatov and Teymur Kheirkhabarov

19.02.18 — 09.03.18 — Calculus with Dmitry Ivankov

12.03.18 — 30.03.18 — Malware Reverse Engineering with Vladislav Stolyarov, Victor Chebyshev and Boris Larin

09.04.18 — 27.04.18 — Incident Response & Digital Forensics with Konstantin Sapronov and Ayman Shaaban

09.04.18 — 27.04.18 — Linear algebra with David Zmiaikou

30.04.18 — 18.05.18 — Statistical Data Analysis with Evgeniy Riabenko

30.04.18 — 18.05.18 — Probability theory with Evgeniy Riabenko

21.05.18 — 08.06.18 — Parallel and Distributed + High Performance Computing with Dalvan Griebler

21.05.18 — 08.06.18 — Algorithms and Data Structures with Edith Elkind

11.06.18 — 29.06.18 — Big Data Analysis: Map Reduce, Spark, BigTable/HBase, Distributed Data with Pavel Klemenkov and Alexey Dral

Register for your spot

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

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

What are the exact rules of the rated contest? Since it's non-standard CodeForces round, you could have included more details about it.

Will hacks count into result? Will the ranking be like usual Educational rounds?

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

    I think it's first time, when educational round become rated. Hope problems will have short statements not as this announcement. Wish everybody luck and high rating...!

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

Are there going to be pretests?

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

    I hope not, so that this contest would really feel different.

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

    No, the rules will be completely the same as on the previous Educational Rounds. After the contest we will build standings with Div. 2 participants only and update ratings according to taken places.

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

      And what about hacks? Will they change rating?

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

        I guess answer is NO, because if anyone who belongs to Div 2 and doesn't participate in contest, but have some successfully hack then what is happened? Also anyone can hack a lot of solution, then it arise a big problem in rating change.

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

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

24 hour open hacking phase ?

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

About the rules of rating distribution:

After the hacking phase the participants from Div.2 will be sorted according to ICPC rules (by number of solved problems, and if the number of problems is equal, by penalty). Then the rating will be redistributed according to places in Div.2.

There will be pretests, and the number of them will be larger than in regular Codeforces Rounds, but we don't guarantee that if the solution passes pretests, it will pass system tests.

This might be inconvenient for some participants, but remember that this round is experimental, and we may make ERs unrated again after this round (or change the rating distribution system in ERs).

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

    Does the number of successful/unsuccessful hacks made during the hacking phase affect your rating like in normal Codeforces rounds?

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

      The number of hacks a person made won't affect his/her place in this round.

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

        Why won't affect ?
        If I will hack someone who solved 1 problem more than me, he will fall and I will in place upper :)

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

          What if he is in upper place after you hack, or lower place before you hack...:p

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

    A couple of proposals:
    You may divide all rating changes by 2 (do it "half-rated") due to specificity of edicational rounds.
    Add small score bonuses for successful hacks (hacking is useful for community, so it should be rewarded)

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

      Saw some guy giving the exact same suggestion some months ago and getting some umpty number of downvotes

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

      Anyone can hack a lot of solution. Then it will be a big problem, if there any bonus for successful hack.

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

        -1 penalty or -5 penalty with 1 successful hack will solved this problem

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

Is there going to be more rated Educational rounds?

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

I can't wait to see how rated educational will work. Good luck to everyone!

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

So as i understood it will be a cf round with educational problems which are really nice, with rating system like atcoder and cs academy, no hacks(because they don't count into the rating). What can be better in the world than this???

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

Is it rated? And if it is rated, can it became unrated?

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

I think that you should write into the description with really big letters that is rated because some don't see it very well.

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

Спасибо что решили сделать рейт ) но не могли бы вы объяснить как будет проводиться раунд , когда начислять рейт ? через день или в тот же день и как там с хакингом ?

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

Участники с див1 могут принять участия просто так ? и можно ли их взламовать или могут ли они взламовать других ?

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

Лучше сразу написать все правила и как будет проходить раунд все такое что бы каждый раз один и тот же вопрос не задавали

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

Make next educational contests rated

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

So will system tests happen after the 24 hour hacking period so that hack cases can be added into the system tests?

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

You say: Educational rounds primarily pursue educational and training goals, rather than competitive ones. But edutcational is rated. Don't be so

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

Paradox :D Last official rated rounds — unrated. Next official unrated round — rated.

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

Will the rating change after the contest ends or it will change after 24-hour hacking phase? If it change after 24-hour hacking phase, will hacks affect to a participant's rating?

Hope this round will be the best rated Educational Round ever.

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

    Of course rating change after 24-hour hacking phase, because final system test occur after 24-hour hacking phase. Hack means a wrong solution, so rating must be affect with hack.

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

OMG! That's good!

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

What is the influence for penalty if I hack others? I have a suggestion. If I hack others successful, I got -10 min penalty, otherwise, I got 20 min penalty

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

I think it's first time, when educational round become rated.

Hope problems will have **short** statements not as this **announcement**.

Wish everybody luck and high rating...!

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

Is it "Rated"?

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

Will all Educational Codeforces Rounds be rated?

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

Rated educational contest: ACM with semi-freezing for the entire contest including yourself

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

Codeforces probably will be more and more interesting!Come on!

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

That's just a suggestion.

You can add another Rating Criteria say Educational Rating and make all the Educational Round rated based on the usual rating system or any other rating algorithm.

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

It'll feel more different if there would be no pretests and 1 day hacks.

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

Is it rated?

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

finally there will be Edu. Round in my contest list :-)

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

Why this page is not included in "HARBOUR SPACE UNIVERSITY" page as Educational Codeforces Round 32 Announcement?


UPD: It was updated.

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

I hope all Educational Codeforces Round get rated for div.2 and high rating for all participants :D

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

I'm a newbie =)) everry body who can help me how to study as well in IT

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

Good luck to everyone! We're all eager to know how this will work! Anyway, I want to mention that I'm okay with frequent changes of how the contests work, but I would like to maintain the situation of having one weekly contest that isn't rated(besides of other rated contests). What do you people think?

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

Могут ли участники див 1 после раунда взламовать ? или имеют права только див 2 ?

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

    Взламывать могут все и кого угодно.

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

      Я так понял что раунд пройдет в обычном формате Educational и в конце измениться рейтинг для див2 ?

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

Is score will be Based on the time of submission??

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

best thing to an educational round :D

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

Again 30 pages queue :\

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

Experiment Failed. ( Long Queues )

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

12 minutes to surpass the queue (and received a WA after that). Either Codeforces server is running into trouble again, or you guys haven't anticipated enough about the number of submissions in educational contests...

UPD: Things are getting a lot better now. Can't compensate the issues, but still cheers ;)

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

    It's not our problem. So what do you want?

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

      Actually, it is. The pressure of waiting for judgement for your "threshold" problems — that means the "just right" problems, hardest you can solve in a contest — is increasing dramatically due to long queues. Also, nobody enjoys an environment with bugs and issues. They should be reported so that the administrators/moderators or the contest setters could figure out and attempt to fix it.

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

Is it rated?

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

In queue for more than 15 minutes!

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

Codeforces improves significantly!! There are only 27 pages of queue now.

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

Надо сделать не рейтинговый раунд рейтинговым, чтобы сказать что он будет не рейтинговым.

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

I think new diagnostics of solutions in c++ failed the crash-test...

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

Why is the answer for a 3rd test case in problem D is 2? No explanation given as well as this question is also not well framed.

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

    The answer is indeed 2. I am not sure whether I am allowed to give you an explanation in the middle of the contest.

  • »
    »
    6 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
    Optimal:
                  1   2   3   4     5 
    Mornings      0  +5   0   0    +11
    Day Balance   0  0    0   10   10
    Evenings      -5  0   10  -11   0
    

    In check-days we have non-negative balance, balance always less or equal than d.Answer: 2 deposits.

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

    i was a bit confused too, but then i got that we can put some money to account before 0 operation comes in the evening

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

I think contest is going well.Queue is for having many test cases than regular contest :) Though sometimes it is bothering,but well enough comparing with bad pretest.

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

I hate D.Why you don't give an explanation to example when you know many people can't understand it clearly?

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

Is it Rated?

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

How to solve E?

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

    first preprocess all the lowest prime factors, factorials and their inverses up to 1e6+5. Then for each x find the powers of each prime in x. You can need to distribute each power in y buckets. (basic stars and bars problems) Also to accommodate negative integers see that you can have even number of negative numbers. So final answer will be:

    Calculate 2y - 1 by fast exponentiation. So time complexity: O(t * log(max(x, y)))

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

Anyone who failed a pretest got screwed with penalty time.

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

The submission 32583028 got TLE, but then 32586076 got AC while I only changed the compiler from "GNU C++17 Diagnostics" to C++11 (and lld to I64d). How to explain this phenomenon?

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

Will rating be calculated according to your standings without Div 1 participants (kind of like Div2 rounds with out of competition Div1 competitors) or like a combined round?

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

    I think it maybe a Div1+Div2 round and only to rate for Div2

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

      Okay, based on what BledDest said, I think it'll be according to your standing among Div 2 competitors only. Correct me if I'm wrong.

      "After the hacking phase the participants from Div.2 will be sorted according to ICPC rules (by number of solved problems, and if the number of problems is equal, by penalty). Then the rating will be redistributed according to places in Div.2."

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

For those who got WA on test 49 on D and later got AC, what logical error did you find?

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

hi i cant find the bug in my code

can anyone help ? http://codeforces.com/contest/893/submission/32598508

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

For those who got WA on test 49 on D and later got AC, what logical error did you find?

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

    diff here 32594374 and here 32596916

    my idea was to use two limits mn - mx which the balance should be one of, I missed the case I meet a 0 and not update my mn to at least max(mn, 0) because if that value is below zero, some cases might add to mn which would fail my condition of failing which is mn > d it means you just can't achieve the goal!

    Hope this helps!

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

    While propagating the extra money that you are adding you need to keep in mind that you do not end up decreasing sum below 0.

    Go through this once.

    Let me know if you are unable to understand something

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

    I honestly don't know I got it in the last 3 minutes so after that I started changing small things in my code (I didn't even know if the changes were going to do something or not) and then submitting the code I sent like 5 submissions in 5 minutes I was like crazy.

    Anyway a few of my submissions got AC but I don't know if it's going to stick.

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

could someone help me with problem c I keep getting wrong answer on test 7 link to my solution: https://goo.gl/95gxqy

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

То чувство, когда решал С для ориентированного графа...

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

Good idea make round rated.

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

Сегодня впервые компилятор на КФе не захотел нормально обрабатывать метод eval, игнорируя тернарник в нем. Обидно =(

struct Node {
  Node *lp, *rp;
  int val;
  int eval() { return this ? val : INF; }
};
»
6 лет назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

Сдал Fку через персистентное ДО, работает за O(Nlog2N + MlogN), но считаю это overkill'ом. Я прав?

P.S. Не могу придумать правда тест, на котором там достигается log^2, да и по памяти/времени на текущих рандомных тестах кажется, что это log

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

    Можно было точно без лишнего логарифма взять обычное персистентное ДО на минимум, изначально заполненное INF`ами, а номер версии — глубина, до которой все вершины добавлены в ДО.

    С быстрым вводом меньше 800мс пашет.

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

    Вроде можно за n*logn+m*log(n)^2 обычным деревом отрезков сдать.

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

    Написал дп, которое пытается построить худший случай, и оно всегда выдаёт не более N операций.

    Чтобы было понятно, о чём я говорю: у нас есть дп от поддерева (массив), размера высоты этого поддерева.

    Мы их сливаем по привычному правилу, меньшее к большему.

    Как известно, если бы размер дп был равен размеру поддерева, то слияние заняло бы как минимум O(nlogn).

    А здесь высота, и слияний O(n).

    Но я не могу это доказать (кроме как написать генератор худшего случая через дп).

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

who can share some hacks to show where people made mistakes?

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

How to solve D ???

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

    Here is my submission: 32585910.

    First, I took the prefix sums of all a[i] in the array I called day. I also saved which days a[i]=0 in the array check so I know which days the balance needs to greater than 0. Notice that the balance on day j is day[j].

    Since the balance on day j is day[j], we need to make sure that day[j] >= 0 n days that a[j] = 0. If day[j] < 0, we want to deposit money that morning. Since we want to add money for the minimum number of days, we want to add as much money as possible when we are depositing money. If we add x money to day i, the amount of money on days i...N all increase by x. Therefore, The maximum amount of money we can add on the morning of day i is D-( max(day[j] for j = i...N) ). To calculate max(day[j] for j = i...N), create an array mb where mb[i] is max(day[j] for j = i...N). Loop backwards to create mb. Now, if on day i a[i]=0 and day[i] < 0, we can deposit D-mb[i] that morning. We now need to store that days i...N have D-mb[i] more money. Create a variable add which stores how much money has been added in the mornings.

    If at any point day[i]+add > D, print -1 because the account has more than D burles. If a[i] = 0 and day[i]+add < 0, deposit D-(add+mb[i]) but deposit at least 0-(day[i]+add), otherwise the account will have negative balance. So add += max(D-(add+mb[i]), 0-(day[i]+add)).

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

Can someone explain me problem A in more detail??? I can't figure out my solution(((

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

    start with 2 people (1 and 2), 3 is sitting out. then start a loop and check if 1 wins then swap 2 with 3, so now the players become 1 and 3. 32591094 will tell you the logic. it becomes obvious once you do it by hand.

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

      Oh my god, I roundly got the idea. But can you write the details please :)

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

        initial players 1,2. spectator:3.

        the result has to be between players.so the result has to be 1/2. if result=1, spectator=2, player=3. swap between loser and spectator.

        if result=2, spectator=1, player=3

        now players: 1,3 spectator: 2 ....it goes on till the end

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

          Ok, but when we will reach the end? I can't get it(

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

            end is the end of input elements. array size

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

              Oh yeah, I'm that stupid... But... I'm sorry again, what is the array size....

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

                "The first line contains one integer n (1 ≤ n ≤ 100) — the number of games Alex, Bob and Carl played."-- This n is the no of array elements or size

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

                  Ohh.. I know, I'm so stupid. But how to swap players. That's a problem.

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

                  Go to toilet then have a dinner, again go to toilet and players will be swapped.

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

    You just have to simulate the game, Alex and Bob start playing and Carl is spectating. So if Alex wins ( if the number is 1 ) you change Bob who lost with Carl , now Alex is playing with Carl if the number is 3 means that Carl wins, so you have to change the players again....

    Do this until you find some absurd ( the person who wins is the spectator ) or until the movements finish.

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

      Oh yeah, I got your idea. But I don't know how to implement it. Can you help me please ^_^:)))

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

for problem C, shouldn't DFS with connected components get me the correct answer? I am failing 5th test case. 32595477

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

    for starters, your array should have a size of at least 100001, because you're storing everything 1-based.

    In general, it's a good practice to add 5 elements more to your limit to avoid these problems.

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

      Why count him as starter? He has better potential than you. He tries to solve hard problems. NOT LIKE YOU. So you should get your tongue tied.

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

        Oh my god, he didn't call BeardAspirant a starter. It's just a way of speaking. It's similar to: "Firstly, your array should have a size of at least 100001 ...". And why the hate? Also, who are you to decide who has better potential? Stick to what concerns you.

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

      in general for competitive programming. Generally, you should be very sure about which indices are actually accessed.

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

i solved problem D using segment tree lp. what is the simplest way to solve D?

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

Must we wait till the end of hacking phase to know the rating change?

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

Codeforces give or take points in this contest?

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

    It depends on your rating. In your case (pupil), you won't get any points. For example, in my case (newbie), I will get exactly more than 2500 points.

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

thanks a lot for problem F's time limit

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

Pls, someone tell me, is it correct solution for D?

http://codeforces.com/contest/893/submission/32601001

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

How to solve problem F??

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

    Build a merge sort tree on the <value, depth> of the tree in DFS order. When merging, remove elements so that value is non-decreasing and depth is non-increasing. Then each query becomes over this range, what is minimum value if depth is maximally (depth(x) + k). Solve this by having a fenwick tree or doing a binary search.

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

      thanks man

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

      Can you please elaborate your solution ?

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

      Can you explain the 'process' function in your code? Or, what are you trying to achieve using the fenwick tree?

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

        Yeah that code shouldn't work, and doesn't properly implement what I said above, but I guess it's hard to find tests that make it TLE. I'll write up a cleaner commented version and link it here later today.

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

          Thank you so much.

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

            Alright, here we are. This solution is

            , but runs in around 2.5 seconds (TL is 6 sec).

            First, run the DFS to get a list of nodes in DFS order. Then, build a segment tree on these nodes. For each segment, we keep a map from depth to the minimum value at that depth. Then to get the answer for a segment and a depth d, take the minimum value over all depths <= d on that segment. To do this quickly, use prefix minimums or a fenwick tree. The fenwick tree is overkill here, but would support updates quickly.

            Prefix Minimums: http://codeforces.com/contest/893/submission/32656954

            Fenwick Tree: http://codeforces.com/contest/893/submission/32656865

            Let me know if you have any more questions!

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

              I have used segment tree, instead of fenwick and prefix minimum. Although, I am getting accepted, can you tell me, why is it running so slow ? (3.4s)

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

                Segment trees just run slower than fenwick trees or prefix mins. They have a higher constant cost.

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

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

How to solve E ?

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

How to solve E ?

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

getting TLE in c++17 and clang++17 Diagnostics and accepted in c++14. How?

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

Round should be unrated. Very long queue

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

How to solve A?

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

    You can just simulate the game: have three boolean variables / array of 3 bools and then update them based on who wins.

    If the bool variable corresponding to the player who wins is false (e.g he could not have played in the first place), print -1 because such a win is impossible

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

Really nice problems!

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

For problem C, I have seen that (in hacking phase) many contestants have used dsu using two arrays — cost, parent. But my code shows memory limit exceeded on test 4 with 10^5 sized array — 32587358

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

    You forgot to return a value in the second case of your par function. You are compressing a path but not returning it.

    Hope that fixes it.

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

I made the following observations on E. 1: the number of prime factors of x cant be more than 20. And there can be atmost 8. even when it is 8 it is > 1e6. So build a dp table for binomial co efficient. 2: In order to find the prime factors modify seive table to hold the largest prime factor dividing it. 3: Split x into prime factors. And count the number of walls. (Combination with repetition). and using binomial coefficient we can make C(y+w+1, y) choices ( here 1 is for the number '1'. since i can include it). But here i got stuck. since in these y factors different prime numbers can be different number of times in which i ve to use permutation with repetition (to arrange within them). But how to apply it here. And after that choose any 2, 4, 6,.. numbers in y numbers and again multiply them with the permutations (for choosing negative. ) here also i got stuck. Can someone plz help me

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

    Your logic is correct. For your last part, consider the binomial theorem expansion of (1+x)^n. Sum of all n choose k is 2^n.

    Now put x=-1. You will see that sum of all n choose odd k= sum of all n choose even k. Hence, the sum of n choose even k= 2^(n-1).

    Also, note that the sequence starts from 0 and not 2.

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

      Yes. it is correct for nC2 + nC4 + .. . But i can arrange within them. So it will be (n!/(rep1! * rep2!...)) * (nC2 + nC4 + ..). so how to calculate the (n! / rep!), rep1 = number of times prime factor 1 is repeating. rep2 is no of times factor 2 is repeating.... . for eg, suppose if i ve 2, 2, 3. then i can arrange them in 3!/2! = 3 ways(here n = 3, rep1 = 2, rep2 = 1) . so i ve to multiply that with the answer. here there is 2 times 2 hence i put 3!/2!. But when i choose y numbers, i dont know how mnay numbers repeat how many number of times. So how to solve that.

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

    There is a very simple idea in which you don't have to worry about repetitions -- Let's represent the given number x as it's product of prime factors. Observe that each prime factor is independent of other. So we can calculate the answer for each prime factor independently and multiply it with the final answer. The pseudo code will be something like this:

     res = 1
    for each primeFactor in x:
    c = number of times that primeFactor occurs in x.
    res *= numWays(c, y)
    res *= power(2, y - 1) //Now res is your final answer.

    Now the problem reduces to finding numWays(c, y) efficiently. Observe that we have c apples and we need to distribute them to y people such that a person might not get any apple. So the numWays is just ncr(c + y - 1, y - 1). So the final idea is:

     res = 1
    for each primeFactor in x:
    c = number of times that primeFactor occurs in x.
    res *= ncr(c + y - 1, y - 1)
    res *= power(2, y - 1) //Now res is your final answer.
    Hope it helps
»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can someone explain, how to solve F in detail ?

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

Can someone explain, how to solve F in detail ?

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

Perfectly matched problems for DIV2. Thanks to authors & testers:)

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

Will we see Div 2 ratings after hacking phase finishes?

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

Системное тестирование не нуждается. halyavin всех протестировал))) 132 взломов!!!

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

ratings?

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

No system testing?? The standing page says its the final standings, i thought hack tests will be added before final standings.

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

When we can see the new rate ?

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

When we can see the mew rate?

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

    We have to wait for them to rejudge the solutions with the new tests and then they'll update the ratings.

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

sorry i mean new rate

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

I think if educational rounds will be rated in the future too, I think a feature should be added, the system testing percentage one like normal rounds.

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

System test is too slow................................................

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

really nigga :| its still testing

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

What is the expected time when the main testing will end?

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

In Div 2 C (Rumors),I don't really understand why my first submission isn't working and second is working. I only changed how I set my data type (for example from long long, I switched to typedef long long ll). My first submission results in a wrong answer on test case 5. I am really curious what did I do wrong, so I can know for next time. I didn't change anything in algorithm.

My first submission:

http://codeforces.com/contest/893/submission/32631226

My second submission

http://codeforces.com/contest/893/submission/32631196

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

    Look you change the size of graph, in the first solution, if you add edge (99999, 100000), you have problems

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

    vector <int> v[100000]; and long long niz[100000]={0}; your adjacency list size as well the cost array will not store the 1e5th node values, there is no spaces to it.

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

Editorial?

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

Hey MikeMirzayanov do you need my laptop? I guess it will help the system for judging.

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

When can i see my new rating?

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

System Testing is finally OVER !! How long will it take for rating changes to reflect? :D

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

If I had +65 rating in combined list, shouldn't I have more rating in only Div 2 list? Am I wrong?

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

    Same, I had +77 but ended up with +2??

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

      same here i got +89 but finally it increased by +27

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

        same here, +45 combined, -25 actual rating change

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

        +46 == -11 :/

        I think rating predictor might have been offset from div1 participant, but it should not be THIS drastic.

        Also, as described by always_4ever_5_25__21_SS there are some other issues where rating change doesn't make sense.

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

          my friend had + 108 but ended up with +124

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

            Yes, rating changes are going up/down/everywhere. Many are now providing examples of unfair/nonsensical rating changes. I really hope this issue is resolved.

            P.S Good for your friend :)

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

      I had +68, ended up with -2

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

    +80 but ended up with -8.

    Looks like those who got 4 or more AC had big increases in rating. Those with just 3 heavily suffered from rating loss, regardless of time penalty

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

    Same, CF-Predictor predicted +115 , got +33 only.

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

I didn't understand the rating change fact. Before this contest i had a rating of 1510 and i became 74 (in division 2) and my rating increased by 104. There is another person who became 304 and his rating increased by 98 (his previous rating was 1530). Is it because this is an educational round and things are handled differently???

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

CF Predictor show +74 Rating and Got +8 . don't know how they calculate it .

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

Div 2 only,

Rank 55, previous = 1811, increase = + 125, new = 1936,

Rank 77, previous = 1795, increase= = + 24, new = 1819.

Also,

Rank 7, previous = 1891, increase = +193, new = 2084,

Rank 10, previous = 1757, increase = + 141, new = 1898,

Looks very odd in my opinion, especially the second one.

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

Is there anything wrong with rating changes? BledDest MikeMirzayanov

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

Isn't this weird!

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

Rank 612 — rating 1640 => -42 Rank 1771 — rating 1695 => -53

Why?

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

I was 1526 and finished 441st in the contest and my rating went down, IT WENT DOWN.. HOW AND WHY???

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

I don't think I will be joining rated educational rounds again , I will stick to regular rounds. Waiting for a day for rating change and systems tests + weird rating change (no thanks)

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

    You should also note this is experimental/first time they are doing such a contest, it is very possible they will fix this for this contest and future contests.

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

    Exactly ! If this is how experiments turn out, I will refrain from participating in "rated" educationals from now on. I was so positive and excited about new ratings...but now I am depressed as hell.

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

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

Round should be unrated because the problems were very easy

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

Just an assumption: Maybe while rating they considered only points i.e. number of questions solved. So all those who solved the same number of questions were ranked equally from rating point of view. I assume this seeing the anomaly in the comment section.

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

looks like the new rating is based on the number of problems you solved, not your standing on this contest. It is unfair to change the rating rule without announcement before the contest.

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

It's fixed, the ratings. Thank You.

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

Very Good contest, I like it, very very good. Make more contests PLZ.

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

Отличный был контест. Особенно, что он рейтинговый.

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

Good Contest

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

I noticed that the rating changes did not apply on the Rating page.

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

what the hell!!!!!!!!!!!!!

How you count the rating ???? which process it has changed????

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

    Dude your rating has increased by 101 points. Are you really that angry?

    I mean its all right to know how the rating changes work but you wayyy more angry than some of the other participants who've had their ratings decreased in spite of expecting an increase.

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

My rating increased by 6 and now it shows -11..why?