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

Обратите внимание, что мы напряглись и подготовили дополнительные задачи для Div 1. Таким образом, параллельно с отборочным раундом будет проведен Codeforces Round 380 Div.1+Div.2 (рейтинговый раунд для обоих дивизионов — всё как вы любите). Участвуют все!

Добрый день.

20-го ноября в 12:05 (московское время) стартует Отборочный Раунд 2 (и открытые раунды для обоих дивизионов по его мотивам) олимпиады для школьников Технокубок 2017. Раунд будет длиться два часа, участникам будут предложены 6 задач. По его результатам лучшие участники (но не более 45% от общего числа участников раунда) будут приглашены на финальный этап в Москву. Для регистрации на раунды и участия перейдите по ссылке. Не забудьте заранее зарегистрироваться на раунд. Впрочем, если забудете — не беда. Через 10 минут после старта будет открыта дополнительная регистрация для опоздавших (ее длительность — 20 минут).

Зарегистрироваться на Отборочный Раунд 2 →
Соревнование открыто для всех в виде отдельных раундов для первого и второго дивизионов.
Для всех участников всех трех редакция этого соревнования будет пересчитан рейтинг.

Напомним, что согласно правилам раундов Codeforces во время соревнования ваши решения будут тестироваться только на претестах (предварительном и неполном наборе тестов), а системное тестирование состоится после окончания раунда. Обратите внимание, что претесты не покрывают все возможные случаи входных данных, поэтому тщательно тестируйте свои программы! После прохождения претестов у вас будет возможность заблокировать решение, тем самым получив привилегию искать ошибки и взламывать чужие решения, но отказавшись от возможности перепослать ваше решение при каких-либо обстоятельствах (например, даже если вы найдете ошибку или вас взломают). Со временем задачи падают в стоимости. После системного тестирования учитываются только полные решения. Подробнее про правила соревнований можно прочитать по ссылкам:

Регистрация на олимпиаду Технокубок еще открыта. На кону — значительные квоты при поступлении в престижные технические вузы России и ценные призы. Если вы — школьник 8-11 классов и пока не зарегистрировались на Технокубок, то самое время сделать это:

Зарегистрироваться на олимпиаду →

В финал соревнования будут приглашены лучшие участники каждого из отборочных раундов (но не более 45% от общего числа участников раунда).

Желаем удачи на олимпиаде,
MikeMirzayanov и команда Технокубка

Разбалловка:

  • ТК Отборочный Раунд 2 и Div 2: 500-1000-1750-1750-2000-2500
  • Div 1: 750-750-1000-1500-2000-2500

UPD 1: Спасибо за участие! Надеемся, что вам понравились задачи. По результатам этого отборочного раунда в финал приглашаются лучшие 100 официальных участников. Следующая сотня попадает в резерв, из которой мы, возможно, доберем финалистов в случае отказов, расширения онсайт-площадки или слабых результатов следующих отборов. Рекомендуем и им продолжать участвовать. Вас ждет еще один отборочный раунд.

UPD 2: А вот и наши победители:

Топ-5 этапа Технокубка:

  1. sslotin
  2. Arthur
  3. hloya_ygrt
  4. asokol
  5. Denisson

Топ-5 этапа Div.1:

  1. riadwaw
  2. MrDindows
  3. Belonogov
  4. dreamoon_love_AA
  5. LHiC

Топ-5 этапа Div.2:

  1. Ralsei
  2. NotDeep94
  3. ecvlco397
  4. kongroo
  5. meeeep
  • Проголосовать: нравится
  • +227
  • Проголосовать: не нравится

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

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

And if I am not a Russian-speaking high-school student, I should register in Codeforces Round #380 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 2) ???

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

Does the Division 2 contest get all the same problems as the actual Technocup round or are there going to be unique problems as well?

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

    Division 2 will contain the same set of problems as Technocup Round. Division 1 will contain harder problems.

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

The one didn't write "thank ... and Mike Mirzayanov (MikeMirzayanov) for the great platforms Codeforces and Polygon" in contest description.

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

The midterm exams start tomorrow, which gives me only two options :(( :

A- Participate in the contest and let the exams go to hell.

B- Let the exams go to hell and participate in the contest.

What do you people think?

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

Will the problems be in english as well?

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

Probably got my birthday gift from Codeforces. Div1 Contest on my birthday

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

If i will register in Technocup 2017 — Elimination Round 2, would I have rating change or not? The same question about Codeforces Round #380 (Div. 2, Rated, Based on Technocup 2017 — Elimination Round 2). Will I participate in technocup olymp?

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

    If you register for Technocup 2017 — Elimination Round 2, you will get both rating change and participation, if you register for Codeforces round 380, you will get just the rating change.

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

The midterm exams start tomorrow, which gives me only two options :(( :

A- Participate in the contest and let the exams go to hell.

B- Let the exams go to hell and participate in the contest.

What do you people think?

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

Will division 2 in English? :/ when I registered, I saw Russian sentence :/ so,if the contest will be taken in English please make the reg. page in English.

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

How hard will it be compared to a div 2 round ( like round #379 )? I wanna know if i can solve anything or not

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

Is it rated?

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

The System testing should start now because it takes long time

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

In my opinion, it will be the best contest to everyone!

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

Is Div 1 rated?

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

i've waited this round for 2 weeks, wish it will be an excellent round LOL

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

great :)
what a hurry contest where just ended one Regional :)
by the way All the best to all

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

It's "TLE" when I used "cin" for Problem B(div2)! Sad ~,~!

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

Can anyone hack any submission during contest???

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

Strongest pretests in DIV1 — rare hacks :(

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

How to solve Div 2 D and E?

D seemed like binary search to me but couldn't get anything concrete in time. :/

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

    I solved D using greedy and C using binary search, dunno about E.

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

      How?

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

        In C use binary search to find the least powerful engine that will fit into the time. In D find the maximum number of ships that can be placed in the board. The answer is the maximum number of ships minus real number of ships + 1. Then just shoot so that you remove a possible ship with each shot.

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

          It's funny how C problems are harder to pass than D problems now. :D

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

            They had the same score. But yeah, this D was easier to code than the A imo lol.

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

    Find all the empty segments, and the max. number of ships placeable in the field is sum of (length of segment i / b). Let the number be x, and you need to shoot at least x-b+1 times to ensure a hit. Then just shoot at places where the number of placeable ships will decrease for a sure.

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

    D — greedy — one should take every kth consecutive zero if a=1, dont take last a-1 such places.
    E — consider height of tree to be 1..n-1, calculate answer as function of distinct values not present and values lying outside, take min overall.

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

Worse div1 contest ever!

no interesting problem

no hack

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

If I don't fail system test, this round will be my best round ever.
Good luck to me.
UPDATE: Failed E T T

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

OMG !!! I hate all problems where arrays length is not standard. For example why in problem C array G is '2e5' ???? I had -200 for this mistake. HATE NOT STANDARD ARRAYS LENGTH PROBLEM.

UPD #NOPROBLEMWITHNOTSTANDARTARRAYSLENGTH

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

How to solve Div1 D? I used DP[left][right][k] and it passed pretests with 1.7 sec, but it doesn't seem to be a correct solution..

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

    You may notice, that k <= 100 and -100 <= right - left <= 100

    UPD: where 100 is surely = O(sqrt(n))

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

      So, will pass?

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

      Ah, so the number of states will be less than 4000 * 200 * 100 = 80000000.. Thx for explaining!

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

        In fact, this can be done in O(N^2) memory if you just memoise using a map. This is because the number of papers Igor and Zhenya have taken in total differs by at most O(sqrt(N)) (To increase the difference after they have made an equal number of moves, you have to increase k, and k is O(sqrt(N))). So this actually runs in O(N)*O(sqrt(N))^2= O(N^2). Memoisation ensures that you only use memory proportional to number of states visited.

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

        I read your solution submitted during the contest, is there any trick on implementing? I did almost the same thing as in your code but just got TLE

        • »
          »
          »
          »
          »
          7 лет назад, # ^ |
          Rev. 2   Проголосовать: нравится +6 Проголосовать: не нравится
          1. I always add "fflush(stdout); _Exit(0);" in the end of the main() function. When I use many maps or sets or the elements are too many, it reduces the running time about a few hundred milliseconds.

          2. Consider branching like this:

          if (k <= mem) { ... } else { ... }

          instead of

          if (k <= rem) { ... } if (k + 1 <= rem)

          because it is unnecessary to check "k + 1 <= rem".

          I submitted your solution with these two micro optimizations, and it was accepted. 22377001

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

            Wow! That works! Thank you!!!

            It seems that I have to be very careful with the constants of solutions when their complexity is near the boundary.

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

Looks like O(n*k) solutions passed pretests in div2 C. I should have hacked...

I wonder how many of these were submited.

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

Lets hope system testing isn't late today?

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

How to avoid TLE in DIV2 B? Tried ios.. and scanf but couldn't pass.

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

_how can get the solution or tutorial ?

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

Div1 systest paused???

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

.

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

Honestly I don't see any point setting TL = 1s for Div 1 A so that log(2e9) or slightly slow binary search can't pass.

Edit: My apology. This solution actually fails because of integer overflow when computing (lo + hi) / 2 as pointed out by P_Nyagolov.

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

Кто знает, почему мое решение упало по времени? Итоговая асимптотика же n*m*log(n*m), что должно заходить в секунду.

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

    Надо быть очень смелым, чтобы думать, что n * m * log(n * m) * [много операций с сетом] = 2 * 10^7 * [много операций с сетом] влезет в секунду на джаве.

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

Feels bad when failing 3 contests in two days. :'(

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

My wrong solution 22349543 passed systest, but it will fail on this test:

1 1 10 18
5 6
5

Correct output: 5
My output: -1

I just noticed it just after contest end that I forgot to handle that case, to fix that I should add else x-=V[n]*(llu)h-S[h-1]; on 34th line.

Edit: Wow so fast rating change =)

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

my solution for problem B(div 2) in pyth2 is giving TLE and same solution in pypy2 is accepted,,

poor testing in python

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

What is the test that does this? :)

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

Nice contest !

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

I got TLE on systest on the same test I got accepted in pretests with 920 ms. I used prefix sums on line and columns.

this

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

Mysterious TL in problem A for div 1, test 9

Why is there TL on test 9 in my this solution? http://codeforces.com/contest/737/submission/22357999 It has return code -1, but still even checker should print RE, I don't understand why is it so. Maybe some of you know?

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

I had TLE using cin and cout, but after I used scanf I got AC.

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

    Welcome to CodeForces buddy.

    If you insist on using cin, cout make sure you are using c+14 and use ios::sync_with_stdio(false) .

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

Potato quality pretests making my tomato quality codes to fail since 2 onion type of contests.

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

Почему в 26 тесте(C div2) ответ -1?

1 1 1000000000 1000000000

1 1000000000

1

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

Could anyone help me to find my mistake in problem C ?

http://codeforces.com/contest/737/submission/22349523

I am very eager to know...

UPD : FOUND

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

22356216 What is the problem a***b != a***b ?

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

    You probably print something unprintable e.g null character (it's marked as '?') in output

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

22356216 What is the problem a***b != a***b ?

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

Очень надеюсь, что на финале будут такие же хорошие и сильные претесты, как и на этом отборе. На ответственных контестах это важнее, чем на обычных раундах.

P. s., говорю очень предвзято, так как на прошлогоднем финале с 4-го места и с влажными мечтами об iНиштяках после систестов упал на тридцать-какое-то и даже не получил футболку.

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

    Помню, как в прошлом году в А не было ни одного претеста с NO! И было очень много взломов на эту тему! Кстати поздравляю с первым местом!

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

      Там вроде было интереснее. Все были в одной комнате и наделал ~20 взломов один, кто первый обнаружил.

      Ещё, наверное, плохо то, что на финале все друг друга знают (особенно среди топов), и проверять на ошибки будут в первую очередь своих друзей.

      Школьная олимпиада с претестами и взломами это как-то слишком нестандартно.

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

        Я туточки

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

        Полностью с вами согласен, насчет нестандартности, но поэтому и нравится. Не знал, что один, думал несколько!

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

The participation was rather low today, and I assume the reason for this a slightly more difficult problem A(div 2).

People have come to the contest and decided against submitting I presume. Wouldn't it be great to have a topcoder like system, where u are on the leaderboard if u open the contest ?

Its much more difficult to get a positive rating change with such low participation.

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

    That could be the case for div2; however, for div1 main reason of low participation seems to be a lot of other contests clashing with CF round — OpenCup stage, bunch of regionals (SWERC, CERC, NWERC); also some teams are on their road home from MIPT training camp.

    Issue you mentioned has been discussed a lot of times already, and I don't think there are going to be some changes on it in near future. This system itself is really vulnerable (simply register another account to read problems I guess). It needs a lot of harsh actions — like checking IP addresses of contestants etc. Nowadays people aren't even banned for having multiple accounts or competing in teams using single account (when one account sometimes makes submissions from 2 or 3 cities during a contest). I'm personally fine with it in case we have to choose between platform improvement or having more contests — and improving "fair play" system :) I'm sure that I'm not at the top not because of cheaters but because of other contestants being much better than me :)

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

Is the rating system broken?
I was ranked 995 and my rating changed from 1448->1446(-2). Edit:Nvm, I guess it's due to low participation.

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

22356216 What is the problem a***b != a***b ?

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

Didn't pass C because I didn't sort the array in which I binary searched. How the hell did it even work?

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

    I was wondering why my solution to (div2)B wasn't working until I noticed that I'd erased the part which was reading the data and that I'd been processing uninitialized 2d array. :D

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

I am very heated up right now(actually, not really) I was solving 729A - Interview with Oleg. I thought I had did answer and submitted my code, and I got a "wrong answer". I looked at the test cases, and tried it on my program, but in my program, it printed the right answer.

include <stdio.h>

char d[101]; int N; int f(int n) { for (int i = n; i < N; i += 2) { if (d[i] == 'g'&&d[i + 1] == 'o') continue; else return i; } } void fill(int a, int b) { int cnt = 1; for (int i = a; i < b; i++) { if (cnt > 3) d[i] = 0; else d[i] = '*'; cnt++; } return; } int main() { scanf("%d", &N); scanf("%s", d); for (int i = 0; i < N — 2; i++) { if (d[i] == 'o' && d[i + 1] == 'g' && d[i + 2] == 'o') fill(i, f(i + 3)); } for (int i = 0; i < N; i++) { if (d[i] == 0) continue; else printf("%c", d[i]); } } this is the code. I've got stuck on test case 2. What is wrong with it???

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

    f doesn't return anything if it goes on until the end of the string

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

    Hi, it's more convenient to post your whole submission. Let's say: 22363876. Also, as tfg has noted, your function f doesn't return any number if the control gets out of for loop without ever evaluating else clause. The behaviour of function f is therefore probably undefined and it just so happens that it returns correct value on your (and mine) computer, but not on the OJ. One way to modify this could be for example:

    Code

    That being said, it might not be the most beautiful solution to your problem. By the way, if you compile your program with "-Wall" flag, it gives you a warning:

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

      thank you very much :D, I'm new here, so I didn't know how to ask... Sorry

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

Hey, how to solve Div1B?

Thanks.

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

    We have to change as few zeroes as possible to ones so that it is impossible to place a ships on the zeroes. Calculate for the initial configuration how many ships can be placed. After that, greedily remove the possibility of placing a ship, whenever there are b consecutive zeroes (i.e. change the b-th consecutive zero to one). Do it until fewer than a ships can be placed.

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

Any suggestions for div2E?
I used this idea: consider it to be a tree, so each node has it’s depth (number of superiors) If the tree has it’s total depth K, then there should be all integers in range 0 – K and not any deeper than K.
So, for each K in range 1 — N I check how many changes I need to make in order to make the tree with depth equal to K. Any idea why it wouldn’t work?
Here is the link of my try.

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

    That's the right idea.

    You check how many changes you need to make to create a tree with total depth from 1<=K<=N-1 (a tree with only a 0 has depth 0). All numbers from 1 to K must be present (there will be only one 0) so to do that you check if you can use the numbers > K to fill the gaps since you will have to change them anyway (to K or some other number lesse than K). If it still isn't enough, you will have to use the numbers from 1 to K to fill any missing gaps. If you consider the numbers that are 0 and aren't the chief as N, you will get the right answer since they are wrong and you need to change them.

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

      Thanks!
      My wrong was that I used only those who had 0 depth to fill the gaps, didn't use those which are > K

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

Проходят просто 100 первых или 100 первых,непрошедших в предыдущем раунде?

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

When will be editorial?

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

When will the editorial published? I couldn't figure out the solution of C. Can anyone explain it please.

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

    Sort the cars by their volume of fuel and use binary search to find the first car that can arrive to the destination in time, lets say it's the k-th car. Then just itterate through all cars from k to n and pick the one which costs the least.

    My code. Sorry but it's pretty ugly :D

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

      Thanks a lot i got it.

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

      Rudy1444

      Could u explain / prove these lines of code ?

      d2=a[p].first-d;

      d1=d-d2;

      time+=(2*d1+d2);

      thanks in advance !

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

        D1 is the distance he will travel normally and D2 is the distance he will travel accelarated. So we have D1+D2=D, where D is the total distance. Also he uses 1 l/km in the first case and 2 l/km in the second so D1+2*D2=V, where V is the volume of fuel. So we have D2=V-D, D1=D-D2. The we just find the time. I'll leave proving the time formula as homework :D

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

    We can binary search the least fuel f we need to get to the destination in time. And the answer is the cheapest car whose fuel limit is larger than or equal to f. Now the question is: how to check if we can get to the destination in time with a certain fuel limit.

    Denote the distance between a pair of adjacent gas stations as d, the distance we need to drive in accelerate mode as a, the distance we need to drive in normal mode as b, the fuel limit as v, and the shortest time we need to get to the destination as t.

    In order to get to the destination as fast as possible, we should use as much fuel as we can.

    If 2d ≤ v we can always drive in accelerate mode, i.e. t += d;. If d > v then we don't have enough fuel even if we always drive in normal mode, so return false; in your check function.

    Now we only need to consider the case when d ≤ v < 2d. Because we need to use as much fuel, so we have the following two equations:

    2a + b = v and a + b = d.

    Solve them, and we get a = v - d and b = 2d - v, i.e. t += (v-d) + 2*(2*d-v);

    You can check my code for more details. Remember to use long long type or set the upper limit of the binary search to a little bit more than 1e9. I set the upper limit to 2e9 during the contest and it overflows :(

    My code: 22361702

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

I try to use an unordered_map to solve Div1.D during the contest but got TLE on pretest 9. After the contest I checked some successful submissions made by others and found that they also use unordered_maps. Are there any tricks when using unordered_map to speed it up?

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

    Not sure if this is the case here, but sometimes they have testcases that specifically catch unordered_maps. I think it's stupid, but it's happened in the past that you need to use the normal map (which is a bst) to pass the test-cases which are designed to specifically beat unordered_maps.

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

When will the editorial be published? Or is it published already? The last round of technocup didn't link it's editorial to the problem page so I am concerned that the same thing might happen again.

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

    Looking for help in solving div1E.

    I have drafted the minimum time should be max single machine/child play time, and I should rent second machines greedily by the length of play time queue. However, I have no idea how I should cope with providing a valid schedule.

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

mfw practicing a day after the contest was held

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

Free Fuel IN C WoW!