Автор awoo, история, 4 года назад, По-русски

Привет, Codeforces!

В 10.04.2020 17:35 (Московское время) состоится Educational Codeforces Round 85 (рейтинговый для Див. 2).

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

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

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

Задачи вместе со мной придумывали и готовили Роман Roms Глазов, Адилбек adedalic Далабаев, Владимир vovuh Петров, Иван BledDest Андросов и Максим Neon Мещеряков. Также большое спасибо Михаилу MikeMirzayanov Мирзаянову за системы Polygon и Codeforces.

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

Так же от наших друзей и партнёров из Harbour.Space есть сообщение для вас:

Codeforces and Harbour.Space

Привет Codeforces,

Какой это был сумасшедший месяц!

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

Мы временно закрыли наш кампус и перевели наши занятия в онлайн.Это не так плохо, как кажется, мы всегда знали, что будущее цифровое, поэтому мы уже готовились к этому моменту. В любом случае, мы вернулись.

Специальный приз для EDU ROUND 85

Эта трансформация открывает двери для некоторых довольно удивительных новых возможностей, которые позволяют нам стать ближе к нашему сообществу, где бы они ни находились.

Вот почему у нас есть специальный приз для следующего Educational Round, место на курсе по вашему выбору из наших программ по компьютерным наукам. Вы сможете учиться у нас онлайн в течение 1, 2 или 3 недель у лучших в области компьютерных технологий (все сборы за наш счет).

Приз будет вручен трем лучшим пользователям, которые подтвердили свое желание участвовать в этом конкурсе. Чтобы участвовать, оставьте нам свой хэндл в форме ниже.

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

Мы надеемся, что это даст вам дополнительный стимул для участия в раунде, и мы с нетерпением ждем встречи с некоторыми из вас в ближайшее время!

Поучаствовать

ПОЛНЫЕ СТИПЕНДИИ ДЛЯ ПРОГРАММЫ БАКАЛАВРА

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

На данный момент у нас есть два типа стипендий:

The Full Scholarship. Для лучших из лучших: все затраты на обучение покрываются университетом.

The Co-Creator Scholarship. Для тех, кто хочет помочь нам изменить образование: все расходы на обучение покрываются университетом, а в дополнение к учебе вы можете помочь команде Harbour.Space в выполнении их миссии и получить ценный практический опыт в этой области, в течение 4 часов в день работая в команде с одними из самых ярких молодых специалистов в городе.

Заполните форму ниже, и мы свяжемся с вами!

Заполнить форму

С нетерпением ждем встречи с вами и будьте в безопасности!

Всего наилучшего, Harbour.Space University

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

Место Участник Задач решено Штраф
1 jqdai0815 7 153
2 jiangly 7 195
3 amnesiac_dusk 7 244
4 risujiroh 7 290
5 bmerry 7 310

Поздравляем лучших взломщиков:

Место Участник Число взломов
1 greencis 174:-53
2 Java 94:-8
3 hackVerly 55:-2
4 mosemAlanfgar 55:-10
5 TheScrasse 40
Было сделано 2405 успешных и 1303 неудачных взломов.

И, наконец, поздравляем людей, отправивших первое полное решение по задаче:

Задача Участник Штраф
A IQOver20 0:02
B arknave 0:02
C Siberian 0:03
D sevlll777 0:16
E LJC00118 0:19
F IceWiz 0:31
G Cirno_9baka 0:25

UPD: Разбор опубликован

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

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

.

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

Wow!!! The last line of announcement is more likely to be said by a ROCK STAR than a university staff!!! /m/ LoL :))

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

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

Before reload Oh there are No contests after it

After reload Oh What can I do with these contests

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

I hope the problem statements will not be long

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

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

I hope to become Expert in this contest!! If I succeed I will be Expert in just 7 months of coding!! I hope i can do it!

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

Hope the best for everyone <3

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

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

Hoping for no queueforces and strong pretests!

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

Hoping for strong pretests

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

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

the penalty for each incorrect submission is 10 minutes ?? What does that mean ? also can we hack even after the contest ? I'm a newbie so please explain :-)

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

    For the people who have the same number of problems solved the one with lesser penalty is higher up on the ranklist, penalty is the sum of the time at which each question is solved and also 10 minutes are added to the penalty for each wrong submission. Also the penalty for incorrect submissions is only added if you solve the question.

    After the contest if you feel that a particular solution from a user has passed the system tests but you think that you can provide a valid test case which that solution might fail than you can try that and if that solution fails that particular user will lose the points gained on that question.

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

Me: Codeforces is the savior from boredom. Meanwhile Codeforces : Sometimes it feels, I am the GOD...

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

good luck all))

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

.

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

I've never seen a contest with so poor input examples

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

Hi! I'm a newbie.I started doing competitive programming in march'20. Since then I have given almost 10 contests on codeforces but everytime I am able to solve only the first question. How can I improve? Which path to follow?

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

    In your level you can try to solve problem 'b' after the contest. And then when your can solve b problem , you can try 'c' ......

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

Hardest Div2 C I have ever seen.

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

    See 631 Div2 That was more harder than this one!

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

    I thought it was super hard for a long time before I realized the explosions only hurt the monster in one direction

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

      Yeah, me too, but then it still was hard to implement, IMO.

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

        nah the implimentation was very easy look at my solution https://codeforces.com/contest/1334/submission/76178082

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

        76131257 Boilerplate and input aside, the actual solution has 10 lines.

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

        try reading my code: 76135183 :)

        Define $$$f(n) = max(0,n)$$$. If start at $$$i$$$, answer $$$count_i$$$ would be

        $$$a_i + f(a_{i+1}-b_i) + f(a_{i+2}-b_{i+1}) + ... + f(a_n - b_{n-1}) + f(a_1 - b_n) + f(a_2-b_1) + ... + f(a_{i-1} -b_{i-2})$$$

        Replacing $$$a_i$$$ with $$$(a_i - f(a_i - b_{i-1}) + f(a_i-b_{i-1}))$$$, number of bullets needed would be ($$$(a_0,b_0) \equiv (a_n,b_n)$$$ )

        $$$count_i = (a_i - f(a_i - b_{i-1})) + \sum_1^n f(a_i-b_{i-1}) $$$

        So, to minimize the number, we compute min of first term (second term is a constant).

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

      What if the question was like "Explosions hurt both the adjacent monsters"? How will we solve it?

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

Any hints for C?

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

    Its easy think :: suppose if we start killing from monster i , then cost of killing all monsters will be ai + (a[i+1]-b[i]) +(a[i+2]-b[i+1])+.... etc.;

    so to solve it we can maintain an array d[i]= max(0,a[i]-b[i-1]) {dont forget for i==1} , we should also find sum of whole d[i] array as S;

    through above info , now we can iterate over our array and check for every position as :

    ans= min(ans,S-d[i]+a[i]); in O(N) time;

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

    just above you

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

What's the logic for E? The fact that I couldn't even factorise D (10^15) stumped me. How to solve it without factorizing it? Or does the method draw the factors online from the queries... Very interesting problem to say the least. Thanks.

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

    You can factorize $$$D$$$ in $$$\mathcal{O}(\sqrt{D})$$$ :)

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

      You can loop upto 3*10^7? I thought you couldn't go beyond O(10^5-6) operations ;(

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

        You can go up to around 3*10^8 operations lmao.

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

        Wow, how did you even reach Candidate Master without knowing this?

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

          The inputs are generally O(10^5) and solutions are either O(n) or O(nlogn), neither of which pushes the boundaries. I don't really have a sense of how many seconds stuff takes, just in relation to what it generally is.

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

    nvm I misread your comment.

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

      Do we have to make graph or is there any other trick because most of people doesn't used much space?

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

        Optimal path is x -> gcd(x, y) -> y. Every path from x to gcd(x, y) by going down is valid, and every path going up from gcd(x, y) to y is valid. Answer can be calculated by multinomial coefficient.

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

The person in first place made his code obscure, that is a violation of the rules

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

got TLE on question A , in aprogram with O(n) time complexity , question A and B were easy but with strong test case

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

    Well if you got tle it means your program wasn't O(n)

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

      program of O(n) but i made one silly mistake , i did this :- int n; int A[n],B[n]; cin>>n; here some very big random value was taken by compiler as value of n was taken input in third line,but i was using it the value of n in second line too and my program mulfunctioned

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

    iamxlr8 A with strong test case?

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

Problem F. Please, explain first testcase. I can't got 20. Sum of all p is 41. Max sum of b in a is 16. Why 20 in answer?

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

    It's not incredible, it's just obscured.

    Each variable/function/class name is replaced with ReplacementFor_ (eg. the struct TREE becomes ReplacementFor_TREE). Numbers are decomposed in HEX+DEC-HEX form (eg. 0 becomes 0x113c+1395-0x16af). String/char are written with ASCII code (eg. "YES" becomes "\x59\x45\x53"). Moreover, every non-essential spacing, line-break or indentation is removed and then random line-breaks are put here and there in unusual places.

    He/She has made a simple script that obscures the code before submission so that it's harder to copy/paste but otherwise exactly identical to the original one.

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

      Code obfuscation is not allowed, for good reasons. This kind of code is more or less unhackable.

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

    In the last contest, his codes for A, B, C were of quite different styles. I suppose he did this to reduce suspicions this time.

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

    Can you please tell just basics..what he has written. I was unable to understand

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

Any hints for D? I used OEIS Sequence but got WA on test 2.

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

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

What was test case 2 in D?

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

For C, I took a damage array and at each position I stored the difference(its zero if difference is negative), then I calculated the sum of all the elements in the damage array and also the element where I would start, which is the least possible a[i] value. I know I count a value twice, I even subtracted that from the final result. What was I doing wrong?

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

    Are you sure you always select the optimal start? It's optimal to select the one which has maximum diff[i] — a[i] (or equivalently minimum a[i] — diff[i]).

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

Can anyone tell me the complexity of Problem C?

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

Can you imagine the feeling of finding the mistake 2 minutes after the contest end?

I feel really great!

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

This C is so hard lol while D is braindead.

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

is there any edge case in problem A?

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

Problem C: Idleness limit exceeded on test 3. Note: this is not TLE (time limit), but idleness limit.

Does anyone have any clue why these submissions failed with this weird error on G++ x64? I thought this might be because I don't flush the output ('\n' instead of endl), but the second one also failed:

(Edited for clarity).

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

    same problem occured with me too my solution was of O(N) still got TLE

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

      I edited the comment to be more clear. I don't have TLE, I have ILE, whatever this means. I've never seen this error before.

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

    Try removing those print()s and submit 76193796. It turned to TLE.

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

      Thanks a lot! It works without the debug output (76199653), just like my other submission during the contest. But I'm still surprised it didn't get TLE outright: maybe it's because the solution was unable to read all input before the time limit?

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

What is hack case in problem A?

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

I cannot wait for the editorial.. I solved C question in O(n) time . yet it shows TLE in Case 3. tried everything to remove it. Does it have better solution?? Can't think of any :( If yes, please reply to this:)

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

how to solve F and G?

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

Is there anyone whose same solution for div2C get TLE in python but get accepted in c++ ?

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

    Codeforces reply to my query regarding the same issue: Unfortunately, this is the way things are on most programming contests: it is not guaranteed that each problem can be solved in every language

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

Can anyone explain why am I getting TLE on test case 3 for problem C? My solution — https://codeforces.com/contest/1334/submission/76172390

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

G: is it finding (s_i-t_i)^2 * (p(s_i)-t_i)^2 summation across all the substrings using fft. Or are there better ideas.

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

What is the usage of input l and r in problem D? I am not understanding what should be output :(

For example, the provided test case n = 3, l = 3, r = 6. The lexicographically minimum cycle is 1 -> 2 -> 1 -> 3 -> 2 -> 3 -> 1. How is this converted to an output of 1 3 2 3 ?

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

76190416 can anyone explain why in problem C , TLE occured in my code. I think the time complexity is O(N)

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

    try fast io .

    ios::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0) ;

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

      it worked using this line struct {(){ios_base::Init i;ios_base::sync_with_stdio(0);cin.tie(0);}}_

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

I think there is a mistake in the validator for problem C. In the problem it is stated that $$$1 \leq n \leq 300000$$$, but when I tried to hack, the validator states

Validator 'validator.exe' returns exit code 3 [FAIL Integer parameter [name=n] equals to 1, viola... range [2, 300000] (test case 1, stdin, line 2)]

Why are the bounds different?

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

    +1, WTF? I submitted a solution that failed on $$$n = 1$$$ and spent 12 minutes submitting a fix (because of something unrelated to the test case itself). Now I tried to hack myself and apparently I shouldn't have even bothered, because the test is not allowed?

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

    Unfortunately, this is true. We excluded the tests with $$$n = 1$$$ just before the contest to exclude unnecessary casework, but we forgot to update the statement :(

    We are sorry for that.

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

He's back. 76138708 , 76144561 , 76160631

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

Going live on YouTube explaining A, B, C: https://youtu.be/FDbd_sYP7hM

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

A — check that all p[i] >= c[i], p[i] >= p[i-1], c[i] >= c[i-1], and p[i] — p[i-1] >= c[i] — c[i-1].

B — sort the array and check every suffix.

C — The explosion of the last monster killed is always wasted; we can utilize all other explosions. The number of bullets saved by an explosion is equal to min(b[i], a[i+1]). The answer is the sum of a[i], minus the total number of bullets saved, plus the lowest number of bullets saved by any explosion.

D — The sequence is always of the form 1 2 1 3 1 4 ... 1 n (cycle for n — 1, with each element increased by 1 and the last element excluded) 1. Use simple recursion.

E — The shortest path is always from u to gcd(u, v) to v. To find the number of paths from a to b where b is a factor of a, consider the value x = a/b. Each time we make a move, we eliminate a single prime from x. The number of paths is therefore t!/p1!p2!...pn!, where t is the total number of prime factors (counting repetitions) in x, and p1, p2, and so on is the exponents of the individual prime factors. Multiply the answer for (u, gcd(u, v)) and (v, gcd(u, v)).

F — Use dynamic programming. f[i][j] represents the minimum cost if we consider the first i elements of array a, with j elements of array b already placed. Optimize the transitions with BIT, after noticing that each time, we simply add p[i] to an interval and take care of the case where a[i] is equal to an element of b.

G — Define f(x, y) = (x — y)^2(p[x] — y)^2. Observe that if x and y matches, f(x, y) = 0; otherwise, f(x, y) is always positive. Then we just have to compute sums of the values f(x, y) to determine if two strings match. Optimize the process with FFT after reversing one of the strings.

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

Codeforces should give a note on C problem as it uses fast IO in CPP I had not used until my 6th submission. I am not new in CP as I knew about it but still, they must give a note so that we can check it once in our solution

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

    The problemstatement says there are up to 300000 monsters, each data on one line, each two integers.

    Fast IO is a really basic thing.

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

I think I solved C, but reading TLE with python3 :(

First note that if monsters weren't in the cycle (but in a line) then there is only one solution and you have to shoot the first monster on the left and then the next monster that didn't die from explosion and so on …

Now with the cycle you can notice is that if you shoot a certain monster it breaks the cycle and the solution to the line is just shoot next monster that didn't die. Now which monster to shoot first then?

Naïve approach is to N^2 for each monster, shoot it and walk in a circle. But you can also prove that you don't need to solve again for the next monster you pick. Instead, if you solved for i-th monster, (i+1)-th monster will take sol[i+1] = sol[i] + min(a[i], b[i-1]) — min(a[i-1],b[i-2]), that is you're adding current a[i] (unless it didn't die from b[i-1] before) cause you're starting with it and subtracting a[i-1] cause that one dies off explosion (unless b[i-2] didn't kill it). b[i-1] and b[i-2] serve as upper bounds.

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

Pretests for problem A are too weak..

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

In pretest , one testcase is missing and many codes are hacked for that particular testcase. (Those codes were Hacked Who didn't check "c(i)-c(i-1) <= p(i)-p(i-1)" this condition) Testcase : 1 2 4 1 5 3

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

    I'm confused because I failed pretest 2 when I didn't check c[i]-c[i-1] <= p[i]-p[i-1], and adding that line was the only change to get ac

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

      You got wrong answer because you didn't check if c[i] >c[i-1] then p[i] > p[i-1] but only checked independently that two array should be non decreasing so that's where you got wrong answer not because of c(i) - c(i-1) <= p(i) - p(i-1)

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

RIP for problem A

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

Does Educational Codeforces Round has FST after hack?

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

I get struck in recent greedy questions, but struck less in the previous ones. Why? I can't get it? Please help me with ideas and tutorials how you approach greedy problems

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

Today's $$$E$$$ was a bit tricky to prove.

Firstly, let's represent any number $$$x$$$ by a sequence $$$x_i$$$ where

$$$ x = \prod_{i = 1}^{n}{{p_i}^{x_i - 1}} $$$

where $$$p_i$$$ are all the $$$n$$$ primes from $$$1$$$ to $$$n$$$.

Now, observe that the weight of the edge from $$$x$$$ to $$$y$$$ will be

$$$ w(x, y) = \frac{\prod_{i = 1}^{n}{y_i}}{y_k} $$$

where $$$x = y \cdot p_k$$$. (Why ?)

Now, if we want to go from $$$u$$$ to $$$v$$$ in the graph, in each step we can either add $$$1$$$ to some $$$u_i$$$ or subtract $$$1$$$ from some $$$u_i$$$. As we want to find the shortest path, we will reduce $$$u_i$$$ by $$$1$$$ only if $$$u_i > v_i$$$ and add $$$1$$$ only if $$$u_i < v_i$$$. Also, its optimal to reduce all $$$u_i$$$ which are greater than $$$v_i$$$ before increasing any $$$u_i$$$ which are less than $$$v_i$$$. Both these statements can be proven.

Now, consider all $$$i$$$ having $$$u_i > v_i$$$. In what order would you reduce these? I claim that the order in which you reduce these doesn't matter.

Proof

Thus, the number of shortest paths is the number of ways to reduce all $$$u_i > v_i$$$ to $$$v_i$$$ multiplied by number of ways to increase all $$$u_i < v_i$$$ to $$$v_i$$$.

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

    For your proof block, there is a much simpler proof: if you go from u to w where w divides u and always step by removing a factor, the cost is just the number of factors of D that divide u but not w, regardless of the path.

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

      Wow. Short and beautiful

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

      Wow! Now, my proof looks stupid :(

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

        I was about to start trying something like your proof, but I decided that I'm too old to enjoy grinding through that sort of maths :-)

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

      I agree, If I am going from u to w and w divides u, then cost will be number of divisors of u — number of divisors of w.

      now the cost of going from u to v trhough gcd will be: c1 = cost(u --> gcd) + cost(gcd --> v) = number of divisors of u + number of divisors of v — 2 * number of divisors of gcd

      however, there is another possible path: u --> lcm --> v and its cost is: c2 = 2 * number of divisors of lcm — number of divisors of u — number of divisors of v

      why is c1 always better than c2? I was not able to prove this, and I submitted a solution based on that c1 is always smaller and it got accepted.

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

    Another proof: In any sequence of primes that got removed, we can swap adjacent primes in the sequence and the total weight of the sequence(path) doesn't change. Hence every sequence has same weight(since we can transform one sequence to other using adjacent swaps).

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +32 Проголосовать: не нравится
    Both these statements can be proven.

    That's what I'm always saying when I can't figure out any nice way to prove it :)

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

I wrote solution for C with O(N) time and O(1) memory in Python3 but got TLE on test 3. I tried to optimize input reading and other possible bad performance cases but still have TLE.

I suppose, that it can be some I\O mistake (like input() on empty stdin) but can't even imagine, where such mistake can be in so simple python code.

76161270

Is there someone with similar problem? (Or maybe someone can find mistake in my solution?)

PS. I even try to rewrite this code in C++ (76168690), but result is the same = TLE on test 3. I definitely miss something important, but I can’t understand what exactly

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

    Try to add these three strings in the beginning of main function:

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
»
4 года назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

It is so frustrating when you get TLE bcz you use python. Today in Problem (C) it happened with me. I think it can be avoided, like most of the times in first 4 problems, what went wrong this time, constraint seemed fine for pypy but shows TLE.

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

I have found two plagiarism cases in the last contest(Educational Codeforces Round 85 (Rated for Div. 2)).

Here's the submission links: https://codeforces.com/contest/1334/submission/76179771 https://codeforces.com/contest/1334/submission/76175619

They did the same crime at previous round too (Codeforces Round #632 (Div. 2)). https://codeforces.com/contest/1333/submission/75904417 https://codeforces.com/contest/1333/submission/75907575

Ahnaf.Shahriar.Asif just copied the code from Shafin_Ahmed and added some extra lines to avoid plagiarism checkers.So we can call it plagiarismforces. Kids should get some education from it :p .

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

"Educational" is not in the process of solving problems, is in the hacking phase. Especially,in Problem A.

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

[submission:https://codeforces.com/contest/1334/submission/76137503]

I cannot understand any of DreamLolita submission. Someone please explain it?

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

In C if i declare input arrays as global array it does n't give TLE.else it gives tle. TLE: 76195191 76196229

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

    Because if you declare array locally space will be allocated for each testcase that will consume additional o(n) time.

    But mine got accepted even if i use local array .76145135

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

    for every test case, your array size is N, not n

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

      I didn't get what you want to say ?

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

        in the solve function, which is called every test case, it's allocate array with size N, which is 300007

        so the total is T*N = 150000 * 300007

        if it's only allocate the necessary size, which is n, it's guaranteed the total n in all test cases does not exceed 300000

        make it a global with size N is also ok, because only allocate it once, not every test case

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

Solution to problem G:

Similar to this problem, we define the distance between two strings A and B of length $$$n$$$ as follows:

$$$ \begin{aligned} \operatorname{dist}(A,B)=\sum\limits_{i=1}^{m} (A_i - B_i)^2 \cdot (p_{A_i}-B_i)^2 \end{aligned} $$$

Then we can see that when $$$A$$$ is $$$s$$$ and $$$B$$$ is a substring of $$$t$$$, $$$B$$$ is an occurrence of $$$A$$$ if and only if $$$\operatorname{dist}(A,B)=0$$$. However, in this problem, we want to know $$$\operatorname{dist}(s, t[j:j+|s|])$$$ for all $$$j$$$-s. To do this, we can expand the formula a little:

$$$ \begin{aligned} \operatorname{dist}(s,t[j:j+|s|])=\sum\limits_{i=1}^{m} \text{ } &t_{j+i}^4 - 2(s_i+p_{s_i}) t_{j+i}^3 + (s_i^2+4s_i p_{s_i} + p^2_{s_i}) t_{j+i}^2 \\ & - 2s_i p_{s_i} (s_i+p_{s_i}) t_{j+i} + s_i^2 p^2_{s_i} \end{aligned} $$$

Note that the first and last terms only have to do with on $$$j+i$$$ or $$$i$$$, so they can be easily calculated in $$$O(1)$$$ with prefix sums. The three terms in the middle are related to both $$$i$$$ and $$$j+i$$$, but if we reverse string $$$s$$$, it will only depend on $$$-i$$$ and $$$j+i$$$. To solve for all $$$j$$$-s, it turns out to be a typical FFT problem. So the whole task can be solved with 3 polynomial multiplications, which is fast enough to pass the time limit.

Don't forget to set $$$eps$$$ a little larger to avoid precision problems. My submission: 76170703

Complexity: $$$O(n\log n)$$$

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

    I had a slightly simpler (but most likely slower) FFT solution. My actual submission was dangerously close to the time limit, but I've since come up with a slight modification that's faster.

    For each letter c from 'a' to 'z' in turn, and for each position where S could be placed, count the number of positions where T contains c and S contains either c or p[c]. Sum these counts over all letters, and you can now tell whether each position is a match. For a given letter c, create a 0/1 array U where U[i]=1 where T[i]=c, and similar a 0/1 array V where V[i]=1 where S[|S|-1-i]=c or p[c]. Then to get the count you just convolve U with V via FFT. It's almost certainly slower than the solutions other people have described because it requires 26 convolutions, but should be fast enough.

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

    Here is a very simple bitset solution for G, that can pass with pragmas:76287369

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

Can someone please tell me why am I getting TLE on this code for E

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

Problem A systests are garbage!!!!

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

    Yeah right! There was 1006 test case overall and none contained the case where the increase in plays is less than the increase in clears. I wonder how did they put the test cases

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

      i got hacked... still i m happy cz i got AC in C

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

      actually pretests did contain this case. I failed pretest 2 when i didn't verify that increase in clears <= increase in plays

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

        Well I got accepted in contest without checking for it there’s no magic going on.

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

          weird, I also failed on pretest 2 because of that

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

          Pretest had something like this

          5 2
          5 3
          

          which you passed because of checking

          if (p[i] != p[i - 1] && c[i] != c[i - 1]) { b = false; break; }

          But it fails for this case

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

            Yeah thank you I know that. But this does not justify the available system tests There’s only 4-5 cases to check and they couldn’t do so in 1006 tests. The number of hacked solutions for A speaks for itself.

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

C is educational, taught us the importance of fast IO

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

Can someone please check my code for problem C and tell why it is giving TLE, I think what I wrote is clearly O(n) 76183582

UPD : Used fastio and got it accepted after contest :(

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

I'm really mad with myself :(

I got problem E wrong (WA on Test 22), because I didn't add these two lines to my code. I would have got 101st place as well. :( if (temp > 1) primes.add(temp);

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

    Basically, for D's such as 6 or 15, my prime list is {2} and {3} respectively, instead of {2,3} and {3,5} respectively.

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

    Lmao, I've also had issues with this! I wrote factorization several times, and I knew I had to add "if (temp > 1)" line, but I accidentally wrote "if (temp > 0)" instead, and it took me 20 minutes and 4 attempts to fix it xD

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

cf predictor is not working for me anyone has the same issue?

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

    I uninstalled it.

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

    From the last contest my cf predictor working again..today don't know , what will be happened. Bofore last 3 or 4 contest it was give me wrong prediction too.

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

      Actually it takes some time to refresh . If you do a submission and immediately check cf predictor it still predict till your last submission . Check after 2-3 minutes of submission , it will predict correctly.

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

Almost 1/6th of the submissions of A have been hacked and its not even been 2 hours yet.

nice.

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

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

What is the hack case for C ?

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

For a unsuccessful hack attempt how much score reduce ? please help anyone..

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

    No reduce, no gain.

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

      Then if i hack other solution , no effect on my score or gain rating + point ?

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

        No, also no gain. But the other one falls down in ranking, because one less solved. So you should hack the ones right in front of you in ranking.

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

        In this contest no fall and no gain . generally its +100 points for successful hack and -50 points for unsuccessful hack.

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

For Problem C — "Circle of Monsters", is there any solution got accepted in java?. in practice, i tried the same as the top scorer "MiFaFaOvO" in java, but it says "Time limit Exceeded".

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

Some tests for A 4 3 2 1 3 2 4 4 2 5 3 5 6 2 2 2 3 2 3 1 1 2 2 145 1

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

How do i see div 2 ranking on standings page? It shows div1 participants as well, even if I untick 'show unofficial'

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

For c problem, if any person has set Max to less than 3*10^17. U can hack c. Many persons asking me,so I shared. I hacked 5 in problem C.

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

https://codeforces.com/contest/1334/submission/76160649

This is my link to the code for C this is in o(n) still tle in 3rd case any reason for this like if any further optimization required ?

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

    Many codes written in c++ also got TLE due to large input/output. You can use Fast IO to avoid TLE!

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

screencast of me trying to prove B and E for an hour

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

Is there any efficient way of doing the hacking? Some people hack like a killer machine (+20, +30). Can you just tell us if there is any faster way of doing that rather than seeing hundreds of codes?

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

Why when I want to hack a problem a message is shown "Illegal contest ID"?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    • If you click on "hack it" it will show you "illegal contest ID".
    • Follow this way,
    • Open his solution and click on '#' button (Right Corner) then there is button "hack it" click on that you can hack from there.
»
4 года назад, # |
  Проголосовать: нравится -21 Проголосовать: не нравится

Спасибо вам за очень хорошие тесты. Я люблю Вас. Если бы вы делали нормальные тесты, у меня бы было не -40, а +40 к рейтингу, а я шёл на рекорд. ЕЩЁ РАЗ ПОВТОРЮ! ПРЕМНОГО ВАМ БЛАГОДАРЕН. Делайте , пожалуйста, не ленитесь, нормальные тесты к задачам

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

    Всегда так удобно обвинять в своих багах авторов, которые не отдебажили за вас ваши решения.

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

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

Why my solution in C gets tle in test 3 https://codeforces.com/contest/1334/submission/76201302

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

    you should have used fast input output metods.

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

      scanf/printf??

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

        Yes scanf printf will work

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

          Yeah I got AC. But, why?? Like cin cout isn't working but scanf and printf working. Anyway, I am facing problem on finding solution on greedy problems. How do you guys approach? Any tutorial for beginning?

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

            You can start by solving B problems or questions whose rating is between 1200 to 1500 in codeforces and has a tag greedy. From that, you can easily learn about how greedy works.

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

For B. Middle Class , can anyone tell me what's wrong with my code 76205050 ?

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

    It is a rounding issue because you use float for some reason. Use long long instead.

    PS: Edited

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

      whether I output "i" or "cn" it doesn't matter actually they both are same.

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

      could you please give some example where taking float will fail.

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

        float is 32 bit, it "overflows" the exact precision. Maybe double works better here. I am not sure how much bits double uses for the number, but float seems to have not enough.

        However, long long does not overflow in this problem since 64 bit.

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

    Its working if we use long long int but not for float(because of rounding issue).

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

If I hack my own solution, will I be out of the competition?

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

Here are my solutions to this contest in case anybody wants to refer them

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

Anyone who is able to explain me this code : https://codeforces.com/contest/1334/submission/76166237,

Gets a FREE COOKIE !!

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

10+ new testcases are added for problem C. Will they re-judge every solution over them once again?

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

I have some doubt in C, Just after reading the question I immediately wrote an equation, to kill Ith monster :

f(I) = min(f[I-1] + max(0,a[I] - b[I-1]), a[I])

I couldn't come up with any base case due to cycle. Can we make further progress in this direction?

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

can anyone know ... if i hack a solution will that test case be added to system tests for all solutions of that problem????

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

there is some very unusal things going on here can anyone plz check the codes of https://codeforces.com/profile/DreamLolita this guy.he is from another universe

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

can anyone plz check the codes of this guy https://codeforces.com/profile/DreamLolita.

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

For Problem C

If the explosion kills the next monster, it explodes too"

How to solve if it didn't explode too??

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

    You need to shoot all monsters which are not killed otherwise. Every shoot decreases the points by one. Count the shots, you need to output them at the end.

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

Well, I just realized that I did an HUGE overkill in problem C using a sparse table and binary jumps to calculate the answer fixing each of the positions as the starting one. I definitely should start thinking of easier ways to get accepted submissions :P

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

Has editorial published?

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

rank 1 div2 :3 How to hack it?

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

    I think this guy is a bot!! xD

    do have a look at his submissions for A,B,C.

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

    He has obfuscated his code using a script so that his code would be pretty much unhackable. But that's against the codeforces rules. He did same thing in the last contest(#632) so he was debarred from the final standings.I hope he would be debarred this time too.

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

What are the hacks for problem B??

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

solved

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

    problem is with this statement " avg=(i+1)*x; " i and x are of type int so result will overflow. declare i and x as long long or cast RHS to long long as avg=(long long)(i+1)*x;

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

There's no testcase for B where the test has, 1000 tests and each n value is 10^5. Wasn't it obvious to include that?

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

As open hacking phase is finished, but still solutions of some users is in queue. Can someone explain what does it mean ?

Also When will the ratings be updated?

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

    All the solutions will be judged again including hacks. Then the final standings are released and after an hour or so you'll get your rating

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

Fastest System Testing I ever seen...

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

why is system testing so slow PS: I didn't participate in this contest but I want to stalk my friends's ratings.

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

The longest system test I have ever seen.

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

    It seems that sth went wrong with the website. All judgements have been paused.

    Just be patient, such things take time.

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

Why is System Testing taking too much time? Are the test cases are more than usual or is there any problem with Codeforces server?

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

    I think it is because that Problem A pretests are too weak. Many different main tests apend to system tests.

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

    I think, this is problem with Codeforces server. For last few hours Codeforces wasn`t avilable three times. Too much online during carantine

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

      Even before servers getting down it took 3 hours to judge submissions done till 57th minutes of the contest.

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

        It's because of A. There were a lot of hacks and it's highly likely that most of the hack cases are different. So like KisekiPurin2019 said, all these test cases get appended to the main test cases. So in all probability, there could be 200-300 main tests for A

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

when will we get to see the final standings?

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

Lets guess how much more time it will take to have the full testing. XD

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

Will we get final standing today??

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

Telegram Channel reports: "Due to a power outage, Codeforces and Polygon are unavailable now." Maybe some problems arose as a result of this? Codeforce I believe in you!

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

Maybe the system testing is affected by the COVID19 and it is in the home quarantine now.

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

Are their servers broken??...System testing is stuck at 88%...Why is it taking so long??!!

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

System testing got TLE at 88%

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

Will the system testing continue? Or will the round be unrated?

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

    I don't think so. The round becomes unrated only if something happens during the contest. The contest is completed without any mishappenings.

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

Please, keep on system testing!

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

Can someone give strong small tests cases for F? I'm trying to upsolve but can't submit due to system testing.

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

When system testing gets TLE

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

)

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

The contest was rated but my ratings, didn't update; when will the tutorial be posted?

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

    Seems like codeforces is in some kind of server related trouble. System testing isn't finished yet. Once it finished, you will get your rating.

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

    Unfortunately, the testing of the round is not over yet.

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

Keep calm guys, hopefully before the next round starts the Edu(85) final result will be published.

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

Keep calm guys, hopefully before the next round starts the Edu(85) final result will be published.

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

who know why the rating does not change?it says that rated for div.2!

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

    System testing is somehow stopped due to some server issues. Once the round has been tested completely all the trusted participants will get their new ratings.

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

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

CF, please don’t die, we love you. Just complete system testing.

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

Why codeforces is arranging day long system test in recent time?

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

I want to practice but it is still testing...!! OMG...

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

System Testing Sucks ):

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

All the contestant are in Home Quarantine. Only CF is the true friend at this moment.

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

12 hours hacking phase + 12 hours system testing

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

bmerry Can you explain your non-segtree solution to F?

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

    Sure. Let's call an element of a "special" if it gets output by the function. Let's say that $$$a_i = b_j$$$ is special. For any k such that $$$k < i$$$ and $$$b_j ≤ a_k < b_{j+1}$$$ we need to remove it; this is what cull counts. Note that each element which must be removed will be counted exactly once by this. Additionally, any non-special element with negative cost should be removed; negsum is a prefix sum of negative costs to help find these.

    Now we process $$$a$$$ backwards, maintaining some DP state. dp[idx] is the minimum cost for the suffix processed so far if the next special element must equal b[idx], ignoring elements of the suffix until the next occurrence of b[idx] (but including the costs from cull). If $$$a_i$$$ appears in $$$b$$$, say as $$$b_j$$$, then there are two possibilities to update $$$dp_j$$$: either $$$a_i$$$ is special, in which case we continue from the next occurrence of $$$b_{j+1}$$$ in $$$a$$$; or $$$a_i$$$ is not special, in which case we continue from the next occurrence of $$$b_j$$$ in $$$a$$$. Either way we need to adjust for the negative costs in between.

    Running time is $$$O(m + n\log m)$$$ (log factor from lower_bound), but I think it could actually be reduced to $$$O(m + n)$$$ since elements of $$$a$$$ are at most $$$n$$$ and hence one could built a looking table to do the lower_bound queries in O(1).

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

Bhai 100-200 jyaada lele par system testing krwa de....

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

How much more time will be taken for system testing of this round ! It's stuck at 88% and also editorial is not out yet !

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

Maybe for over 150 testcase of problem A then CF get TLE at 88% LOL

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

I love almost everything of Codeforces but their system testing is not up to the mark.It takes too much time to check all the submissions.They should improve their system testing time.

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

3 hours ago I saw system test was going 88% and I slept

now the percentage is still remain

what the heck is going on

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

Maybe is Um_nik who wants to prove that he is worth as much as 1000 cyans. As shown in the movie : https://www.youtube.com/watch?v=TXju58mzzaU

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

I have no idea if they can't or they don't want to prepare strong tests for during the contest . A lot of solutions got hacked or got WA (lot more than usual) in A,B,C (mostly A and B) which is just sad . I strongly hope the test data for the next contest will be strong :) but anyway I'd like to thank codeforces for making this situation (quarantine) less boring and more exciting

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

.

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

System testing 100%

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

    Few contest before it rolled back after reaching to 100%. How many of you remember that moment ???

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

Is the code after ddl counts? It seems the code which submitted after ddl counts in system test?

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

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

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

System tests are finished

sys

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

Did the whole world going to quarantine, motivated the coders to rise and participate more in coding to prove superiority in the field of quarantine lifestyle?

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

Codeforces servers right now:

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

the queue after every Educational round is frustrating, you guys need to figure this out I don't know maybe not allowing people to submit between the end of the round and the system-tests and maybe reduce the hacking phase to 6 hours instead of 12, it is really slow to rejudge all the submissions made during the last 12 hours on hundreds of tests...

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

Getting aged waiting for rating change O_o

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

awoo where is the top hackers for this round ?

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

    Unofficial top hackers (without unsuccessful hacks)
    greencis 174
    Java 94
    hackVerly 55
    _BadLoser 55
    TheScrasse 40
    yijan 36
    allexceed404 32
    dapingguo8 31
    vovanstrr 26
    harshchhatbar 26
    Amir_Reza 25
    surung9898 23
    rocks03 22
    LinkinPony 22
    nikolapesic2802 20
    Moustafa. 20

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

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

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

From implementation(A),greedy(B),creative thinking(C),to graph theory(D),math(E),data structures(F) and string algorighms(G),this really is a perfect contest.Thanks!

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

From implementation(A),greedy(B) and creative thinking(C),to graph theory(D),math(E),data structures(F) and string algorighms(G),this really is a perfect contest.Thanks!