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

Привет, Codeforces!

В 14.01.2021 17:35 (Московское время) состоится Educational Codeforces Round 102 (рейтинговый для Див. 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, и с Новым годом!

В начале 2021 года мы хотим познакомить вас с новыми возможностями!

Несомненно, в Harbor.Space всегда рады видеть участников сообщества Codeforces среди своих учеников! Наши главные приоритеты — молодые таланты, которые хотят учиться, бросать вызов самим себе и стремятся к постоянному развитию.

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

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

Узнайте об истории успеха одного из наших первых студентов, обучающихся по этой программе.

Дэвид — специалист по UX/UI из Грузии, получивший полную стипендию от венчурного фонда OneRagtime.

Но есть еще много возможностей для обучения в области технологий, предпринимательства и дизайна. Заинтересованы? Оставайтесь на связи и подпишитесь на нас в LinkedIn, чтобы увидеть больше фантастических возможностей.

Желаем удачи и до встречи в следующий раз!

Harbour.Space University

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

Место Участник Задач решено Штраф
1 jiangly 7 201
2 hank55663 7 210
3 BigBag 7 282
4 Lawali 7 283
5 FluffyT 7 306

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

Место Участник Число взломов
1 ariloc 35:-1
2 smax 34:-9
3 mrkarlo 27:-5
4 VTifand 19
5 BlueGagosipda 21:-22
Было сделано 242 успешных и 872 неудачных взломов.

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

Задача Участник Штраф
A Geothermal 0:01
B Geothermal 0:02
C SSRS_ 0:09
D Alfalfa_w 0:09
E _FlyingColor_ 0:16
F Apsara 0:40
G tfg 0:48

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

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

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

Hope this time it will be real educational and not just "educational". Anyway good luck to everyone!

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

Don't forget to notice the usual start time!

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

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

Congratulations to David! It is cool to see internship and job opportunities on CodeForces, even though they are not directly related to competitive programming. Many people start CP to improve programming skills in general, and Educational Contests work well to tie these fields together.

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

My first contest in CF ;)

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

pikmike -> awoo

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

Hoping for a round which is educational

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

If we hack any solution, will we get any points in this contest?

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

good luck for everyone!

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

When people find out this guy IS pikmike, they are like: awoo

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

My first contest drunk ! Less gooo !!!

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

nice C. Also i have no idea why my B, D got AC. Someone please hack them.

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

IITKWPCJ — Harder version of B by PraveenDhinwa

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

D is segment tree isn't it?

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

This contest made me realize that I should maintain a segment tree library.

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

How to solve E? I tried using Dijkstra but it didn't pass

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +8 Проголосовать: не нравится
    Spoiler
  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +86 Проголосовать: не нравится
    Problem E solution
  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    We can convert edge {u, v, w} to three edges {u, v, w, 0}, {u, v, 0, 1}, {u, v, 2 * w, 1}. The fourth element in the edge is use as minimal or as maximal edge. Introduce Dynamic Programming d[v][flag1][flag2] — minimal answer in vertex v, where flag1 = 1, when we used maximal edge, and where flag2 = 1, when we used minimal edge. Calcing the Dijkstra. Answer for vertex v is d[v][1][1]

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

How to solve C ??

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

    It was too complicated for me to find and proof the solution and thus i brute forced and observed the pattern .

    from i=1 to 2*k-n-1 you need to print i itself . After that you need to start from k . For example for n=5,k=5 : 1 2 3 4 5. for n=6 , k=5 : 1 2 3 5 4 . n=7,k=5 : 1 2 5 4 3 . n=8,k=5 : 1 5 4 3 2 . n=9,k=5 : 5 4 3 2 1.

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

    It can be proved that the number of inverse of array B must be more than or equal to A regardless of any permutation. I separated array into two parts p[1],p[2],...p[k-(n-k)-1] and p[k-(n-k)],p[k-(n-k)+1],...,p[k],p[k-1],p[k-2],...,p[k-(n-k)]. If you take a look at the latter part, you can see that, for any pairs of i<j between k-(n-k) and k, there is always one p[i] appeared before p[j] and another p[i] appeared after p[j]. So the number of inverse in the latter part is always constant because any pairs of i and j have exactly 1 inverse. In the first part, the number of inverse in array A is 0 because it is arranged in ascending order and every elements of first part in array A in less than second part. So basically, we have to create any array that the first part is the same as A(or else inverse will be more than A) which is 1,2,3,...,k-(n-k)-1 and second part can be any permutation of k-(n-k),k-(n-k)+1,...,k. and lexicographically largest permutation is k,k-1,k-2,...,k-(n-k).

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

    I'll try to explain with examples

    Let's use $$$k = 5, n = 9$$$
    Initially
    $$$P$$$ = $$$1, 2, 3, 4, 5$$$
    And $$$B$$$ = $$$1, 2, 3, 4, 5, 4, 3, 2, 1$$$
    Notice when you swap $$$5$$$ with $$$4$$$ in $$$P$$$ It doesn't change the number of inversions (because of the mapping b[i] = p[a[i]])
    $$$P$$$ becomes $$$1, 2, 3, 5, 4$$$
    And $$$B$$$ becomes $$$1, 2, 3, 5, 4, 5, 3, 2, 1$$$
    So you can continue swapping the largest number to the left as far as the number you want to swap with has a duplicate value on the right-hand side of $$$B$$$

    Let me use a smaller example
    You have $$$k = 3, n = 4$$$
    $$$P$$$ = $$$1, 2, 3$$$
    $$$B$$$ = $$$1, 2, 3, 2$$$
    You can swap $$$3$$$ to the left once in $$$P$$$
    $$$P$$$ becomes $$$1, 3, 2$$$
    $$$B$$$ becomes $$$1, 3, 2, 3$$$
    And you can't swap $$$3$$$ again
    Because if you swap it left you will increase the number of inversions

    In general
    If you have a sequence $$$P$$$ = $$$1, 2, 3, 4, 6 ... k$$$ and $$$n$$$
    Reversing the last $$$n - k + 1$$$ in values in $$$P$$$ is your solution and the number of inversions remains the same.

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

      why don't we just stop after swapping the last two elements? Can you please explain that because I can't find a test case where just doing that will fail.

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

        ya exactly. i did this as well. a: 1,2,3,4,5,...k-1,k,k-1,k-2,k-3..k-(n-k) b: 1,2,3,4,5,...k,k-1,k,k-2,k-3,...k-(n-k) the only difference is the 3 numbers in middle. in A they gave 1 inversion. in B also they are giving 1 inversion. and for the rest of k-3,k-4,k-5....2k-n,the number of digits greater before them remain same. so in all cases inversions remain same and b is lexicographically greater. and when n==k just print 1,2,3,....k-1,k. pls explain if anyone sees a fault in this

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

        Maybe this will help
        Full visualization for $$$n = 7$$$, $$$k = 4$$$
        $$$P$$$ = $$$1, 2, 3, 4$$$
        $$$B$$$ = $$$1, 2, 3, 4, 3, 2, 1$$$
        Swap $$$4$$$ and $$$3$$$ in $$$P$$$
        $$$P$$$ = $$$1, 2, 4, 3$$$
        $$$B$$$ = $$$1, 2, 4, 3, 4, 2, 1$$$
        Swap $$$4$$$ and $$$2$$$ in $$$P$$$
        $$$P$$$ = $$$1, 4, 2, 3$$$
        $$$B$$$ = $$$1, 4, 2, 3, 2, 4, 1$$$
        Swap $$$4$$$ and $$$1$$$ in $$$P$$$
        $$$P$$$ = $$$4, 1, 2, 3$$$
        $$$B$$$ = $$$4, 1, 2, 3, 2, 1, 4$$$
        Swap $$$3$$$ and $$$2$$$ in $$$P$$$
        $$$P$$$ = $$$4, 1, 3, 2$$$
        $$$B$$$ = $$$4, 1, 3, 2, 3, 1, 4$$$
        Swap $$$3$$$ and $$$1$$$ in $$$P$$$
        $$$P$$$ = $$$4, 3, 1, 2$$$
        $$$B$$$ = $$$4, 3, 1, 2, 1, 3, 4$$$
        Swap $$$2$$$ and $$$1$$$ in $$$P$$$
        $$$P$$$ = $$$4, 3, 2, 1$$$
        $$$B$$$ = $$$4, 3, 2, 1, 2, 3, 4$$$
        So the final value for $$$P$$$ is $$$4, 3, 2, 1$$$
        Notice the inversion never increases or decreases

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

      I wish I could upvote you twice. No youtube videos really helped but your comment did. Thanks Sir. Now I can sleep well ;-)

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

Is it possible to solve D in linear time? Only issue I had was how to find minimum and maximum for suffix. For prefix it's easy.

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

Could someone please explain why the answer for vertex 7 in test case 3, problem E is 3?

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

How to solve D, anyone can explain?, i got run time exceed

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

This contest made me realize that I should maintain a segment tree library.

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

how to solve D and F ? Anyone explain.

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

    D can be solved by range minimum & maximum queries in Segment tree.

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

    I did D by maintaining prefix and suffix minimums/maximums without segment trees. Just eliminate the effect of l to r by adding the cumulative sum to the min and max of the remaining suffix array. The answer is total_max — total_min + 1 Total_min and total_max are overall min and max(from prefix array and suffix array before l and after r respectively) after eliminating the effect of the segment l to r

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

      Thanks, I understood it now.

      I was thinking of Adding the cumulative sum to all elements in suffix array and then to eliminate duplicate elements (which was not even needed...)

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

      Can you explain the logic behind adding the cumulative sum to the min and max of suffix array ? I cant understand it very well.

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

        Hey, so you would add the cumulative sum to nullify the effect of the segment (l to r), instead if adding it to the whole suffix array, you can only add it to min and max because the change is uniform. You only need min and max from the prefix and suffix because all the points between them will be travelled automatically (because the step size is only 1)

        PS — you can imagine it like a continuous graph, in which you remove a segment in between and join the ends if the other 2 segments, you have to bring the right end up or down to meet the left end ( so you add the cumulative sum * -1 which can be positive or negative to negate the effect)

        Idk if this is helpful, not so good at explaining stuff

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

        We need to observe one thing that if we want to know the distinct numbers possible in some ++--+-+++... string then the no of distinct possibilities are mx — mn + 1. (mx is max no possible and mn is min no possible).

        consider 4 vectors pre_ma, pre_mi, suff_ma, suff_mi

        while calculating these vectors we consider that value of x starts from 0

        pre_mi[i] — what is the min value that we came across until index i if we started from index 1.

        pre_ma[i] — what is the max value that we came across until index i if we started from index 1.

        suff_mi[i] — what is the min value that we came across until index N if we started from index i

        suff_ma[i] — what is the max value that we came across until index N if we started from index i.

        Now for each query, we have to consider 1 to l-1 and r+1 to N as combined string and do these operations. Instead we find the max and min possible values differently for both of these prefix and suffix strings.

        So, for prefix string since the value of x starts from 0 we can directly consider pre_mi[l-1] and pre_ma[l-1], but for this suffix string the value of x doesn't start from 0, (But we have stored the vectors if the value of x starts from 0), but this suffix string starts at some value X (Here X denotes the sum of prefix string). so we have to consider (X + suff_mi[r+1] as the min value occured in this suffix string) , same goes for maximum in suffix string.

        Final answer would be max(suffix max val , prefix max val) — min(prefix min val, suffix min val) + 1.

        Link to my code

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

Hi, I encountered some strange errors while submitting a solution in Java for Problem D in the Codeforces Educational Round 102,

The code works perfectly in my local system, it even works correctly in an online Java Compiler(OnlineGDB). However, it was unable to read strings correctly in the Problem D.

My Submission: 104337369

Could someone please guide why this is happening..

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

can i know the aproach for problem div2A

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

    traverse the input array, if there is no number greater than d, print yes. Now sort the array. If the sum of first two numbers is less than or equal to d, then it means that any number which is bigger than d can be replaced by the sum of these two numbers. But if their sum is not less than or equal to d, then we can be sure that no other sum in this array will be smaller than this. therefore, after sorting

    if(a[0]+a[1]<=d) print yes else print no

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

Editorial, please

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

$$$D$$$ was easier than $$$C$$$ at least to me.

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

How to solve problem F ?

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

    Build a flow network as follows: let's create a source $$$s$$$, a sink $$$t$$$, and a vertex for each element. We will try to model the problem as the minimum cut in this network.

    For every element $$$i$$$, there are several elements $$$j$$$ to the left of it that should be taken if we take it. Let's add a directed edge with infinite capacity from $$$i$$$ to all such elements. For elements will positive $$$b_i$$$, add a directed edge from $$$s$$$ to them with capacity equal to $$$b_i$$$. For elements will negative $$$b_i$$$, add a directed edge from $$$i$$$ to $$$t$$$ with capacity $$$|b_i|$$$.

    What does an $$$s$$$-$$$t$$$ cut in this network represent? Let's say that all elements in the same part with $$$s$$$ are taken into the answer, and all other elements are ignored. Let's say that we have some $$$i$$$ that is taken into answer and depends on some element $$$j$$$ that is not taken. Then there is an infinite-capacity edge from $$$j$$$ to $$$i$$$, and it goes through the cut, so the value of the cut is infinite (and we are searching for a minimum cut, so this cannot happen). For each positive $$$b_i$$$, if $$$i$$$ is not taken, the value of the cut increases by $$$b_i$$$ (since the edge from $$$s$$$ belongs to the cut), and for each negative $$$b_i$$$, if $$$i$$$ is taken, the edge from $$$i$$$ to $$$t$$$ belongs to the cut, so $$$|b_i|$$$ is added to the value of the cut. So, the minimum cut actually minimizes the sum of positive $$$b_i$$$ that are not taken, minus the sum of negative $$$b_i$$$ that are taken, so it gives us the optimal answer.

    There's one issue though. This network can easily reach $$$O(n^2)$$$ edges, and that's too much. To reduce the number of edges to something like $$$9n$$$, for each $$$i$$$, consider all divisors of $$$a_i$$$ (including $$$a_i$$$ itself) to the left of it. If there are several equal divisors, then taking the closest of them ensures that we take all other divisors into the answer, so actually, for each divisor of $$$a_i$$$, we need to consider only the closest occurrence of this divisor to the left of $$$i$$$, and add an infinite edge from it to $$$i$$$.

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

      This might be a dumb question (I'm pretty new to flows), but what would be the complexity of this algorithm? Using Dinic's, wouldn't this be $$$\mathcal O(V^2E)$$$, and with $$$V = 3000$$$ and $$$E \approx 9 \cdot 3000$$$, shouldn't this TLE? Or there also just might be some property about this flow graph that makes Dinic faster that I'm not aware of.

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

        The distinctive feature of many flow problems is that it is either very hard or even impossible to construct a testcase on which an algorithm performs anywhere near its worst-case complexity.

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

        Yes, I've also considered this problem. In fact, the model solution is written with the implementation of maxflow in $$$O(VE \log F)$$$ (Dinic with scaling), so asymptotically it should be fine. But my implementation of regular Dinic also passes all of my test cases, I haven't found a test case which it gets TL on.

        So, actually, we have a 100% working solution, but we guess that some asymptotically bad solutions might pass.

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

        In this problem a path saturates a source edge or a sink edge always because the other edges have infinite capacity so the actual complexity is O(V paths) * O(E for finding a path) for any max flow algorithm.

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

Suspicious submission for hacks I think the hacker made an alternate account for hacking this.

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

Screenshot-320

It hurts!

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

Whoever concocted this is genius. They've practically lined themselves up to be caught.

https://mirror.codeforces.com/contest/1473/status/A?order=BY_CONSUMED_TIME_DESC

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

VIDEOTUTORIAL FOR PROBLEM A AND B WITH DETAILED EXPLANATION . I ALSO TRIED TO EXPLAIN LINE BY LINE CODE . I HOPE YOU GUYS WILL ENJOY THE VIDEO LINK PROBLEM B :https://www.youtube.com/watch?v=H3qBEDYwwX4 LINK PROBLEM A :https://www.youtube.com/watch?v=YjC6CcxYxo8

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

In problem $$$C$$$, It's never said that $$$b$$$ has to be the sequence with the least number of inversions. It can be found that number of inversions of $$$a$$$ is $$$(n - k)^2$$$ and the sequence $$$b$$$ builds off the permutation $$$1,2,..,k,k-1$$$ also has the equal number of inversions as $$$a$$$ and it should suffice to be the solution when $$$n \gt k$$$.

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

Screenshot-320

It hurts!

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

Problem C and D video solutions — solution

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

Unable to understand C even after looking the to the test cases that didn't passed. Anyone here could you please help me with proper understanding of C.

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

Hey, I have a doubt regarding problem C.Is the number of inversions in 1 2 3 2 1 is same as that in 3 2 1 2 3?

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

hey someone please help me to debugging my code i got WA in test case 8 of problem E;

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

https://mirror.codeforces.com/contest/1473/submission/104345925 can someone explain what's happening here?

while time.time() &mdash; cur < 1.7:
    pass
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I have a big question could anyone tell me in Problem E how in the third sample the minimum weight to vertex 5 is 7? I can't find a path with lower than 8

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

Hey all, if you missed the post-contest stream that I did on https://www.twitch.tv/stevenkplus, here is the youtube recording: https://youtu.be/3o1Na9Qnaio.

Will edit this comment with links to my submissions (containing solution notes) once I perform the submission process :)

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

Problem E is really cool! I don't know why I didn't consider traversing an edge twice.

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

For anyone stuck in D, https://youtu.be/mMFkvyeRFQY

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

People using Segment tree and MO's algo in problem D

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

Does anyone have any idea what's the mistake in all the solns of E that were hacked?

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

I got lucky for problem C. I somehow looked at the testcases and figured out what to do. This has happened to me in previous contest too . xd

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

can someone instead of flexing that it can be solved by prefix/suffix sum explain how to solve D . I know prefix,suffix but i don't know how to use that in this problem.

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

    create the following arrays :

    MaxTillHere[] -> stores the max value upto a particular index MinTillHere[] -> stores the min value upto a particular index

    then, using backward traversal create the following array :

    MaxFromHere[] -> stores the max increase we'll get after a particular index MinFromHere[] -> stores the max decrease we'll get after a particular index

    now the answer is simple, for each query (l, r) : int max = MaxTillHere[l — 1] + val[i] + MaxFromHere[r] int min = MinTillHere[l — 1] + val[i] + MinFromHere[r]

    ans = max — min + 1

    I hope my answer was clear. Some index value might be wrong here, but i hope you've got the gyst of the solution!

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

When will the rating be updated for this round.

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

То самое чувство, когда написал D, но профейлил с дп и не хватило 3 минут на отправку(

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

Video Tutorial for problem A,B and D link of problem D : https://www.youtube.com/watch?v=botAQ-AZNOQ

link of problem B : https://www.youtube.com/watch?v=H3qBEDYwwX4

link of problem A : https://www.youtube.com/watch?v=YjC6CcxYxo8&t=263s

Hope you guys will enjoy and understand the intution behind the solutions !!!

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

why did they temporarily roll the rating changes back ??

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

why i am getting negative points? i thought in 10 min solved no penalty

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

is it rated for the participants with rating greater or equal to 2100? i fount some people who geater than 2100 is rated

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

My rating was above 2100 before taking this contest, but it was changed because of it. Could anyone tell me why?

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

Hello Codeforces!

I basically got a message that I cheated in this round, and that my rating won't change.

The message I got

I am writing this comment to inform to the codeforces headquaters that the plagarism check system has made a misjudgement.

I was pretty shocked to see this message and other people's codes.

They were similar, and some were even the exact same.

I found no code that was exactly the same to my code, but some were astonishingly similar.

Problem A in this contest was a very simple problem, that had a very simple solution, so there could be some coincidences in people's code.

Also, I confirm that I don't even have a telegram account and have never used Ideone or other online judjes in this contest.

I understand codeforces' work to catch cheaters to make codeforces a better community.

However, for the reasons I stated above, I want to get my rating back.

Thank you! :)

+) I am curious about when, and how I will get my rating back. Will the headquaters contact me via email or codeforces talk?

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

I took part in this unrated contest (for Div. 1) and found my rating changed afterwards. Why? Mistake?

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

Where is Editorial? Also Can you make problem statement clear? Problem C was so much confusing. I understood it only after reading examples.

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

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

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

I dont usually comment because of my low rating which gathers me downvotes...but the broad range of topics tested in this round, be it the use of data structures or algorithms in this round is appreciated. It didn't seem too adhoc like other rounds involved some known concepts to a perfect extent and again the breadth of topics of the questions- just amazing! Kudos to the authors of the contest. Well done! Editorial was fast, question statement lengths and test strengths were optimal. In short, one of the best contests I have ever participated on Codeforces.