Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

# | User | Rating |
---|---|---|

1 | Benq | 3650 |

2 | Radewoosh | 3648 |

3 | tourist | 3579 |

4 | ecnerwala | 3551 |

5 | Um_nik | 3494 |

6 | Petr | 3452 |

7 | ksun48 | 3432 |

8 | jiangly | 3349 |

9 | maroonrk | 3338 |

10 | Miracle03 | 3314 |

# | User | Contrib. |
---|---|---|

1 | 1-gon | 210 |

2 | awoo | 188 |

3 | rng_58 | 185 |

3 | Errichto | 185 |

5 | SecondThread | 182 |

6 | Ashishgup | 176 |

7 | Um_nik | 175 |

8 | maroonrk | 174 |

9 | antontrygubO_o | 170 |

10 | -is-this-fft- | 169 |

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial of Codeforces Round #530 (Div. 1)

Tutorial of Codeforces Round #530 (Div. 2)

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/17/2021 07:44:10 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

"A fat fish can't dangerously eat a fish with smaller weight. Indeed, even if all the smaller fishes eat each other, the resulting fish would be too small. We can conclude that the danger is not greater k−t." How can you conclude that? All fat fish may as well take part only in fights with bigger eels, case in which the argument you have doesn't imply a "lost fight". They as well might fight with each other (you have around t/2 non-dangerous fights from here, and from then on, there's no argument as to why those newly created eels will not take part only in dangerous fights). Could you give a more formal proof for that observation?

Let's take fat fish, say it is

k-th in sorted order. Let's give each fish its mark: it will be 1 for (k- 1)-th fish, 2 for each fish smaller than (k- 1)-th, and 0 for all bigger (including our fat fish). The result of the fight will be fish with markmin(x,y) wherexandyare marks of fishes in the fight. In the end we will get fish with mark 0, so it is easy to see that there will be a fight between fishes with marks 0 and 1 at some moment. I claim that this fight is non-dangerous (any fish with mark 0 is more than twice bigger than any possible fish with marks 1 or 2). Also it is not hard to check that these fights are different for all fat fishes.Can someone explain their easy approach for div2 D with example ?

graph : https://imgur.com/a/Iac4Lm2

Here we see,that s(1) = 1 ==> a(1) = 1.We can say,that a(3) = s(3) — a(1) and a(4) = s(4) — a(1). But can we reduce the answer?Yes.We can put on vertex 2 min(s(3) — a(1), s(4) — a(1)).And this value will embrace all children of vertex(2).So a(1) = 1, a(2) = 2, a(3) = 0, a(4) = 1. Ans = 4.

how a(4)=s(4)-a(3) ???? cant get this part

and also plz explain when will be the answer not possible

1)Fixed.2) If s(u) < s(v), where u is a child of the v

thanx for ur help i got it.

Hi!! This is my code for this problem and I am badly stuck over this problem please help me. https://codeforces.com/contest/1098/submission/102257904 I am not getting what is wrong with my code? Please help me out why it is giving me wrong answer on test case no. 14?

can someone explain more clearly problem b div 2

please provide proof of problem E- Nice Table.

If a row contains three characters, two neighbor rows of each row will be same. If a column contains three characters, two neighbor columns of each column will be same. Thus, in a good matrix, either each row contain at most two different characters, or each column contain at most two different characters.

I have implemented code of @Shtef for problem E in a well commented manner, for easy to understand. If someone don't finds original code easier, you may have a look at my version of same for better understanding. link=> https://ideone.com/Ypsk8P .

someone pls explain implementation of div 2 F problem, i commented it here but was not able to understand. https://ideone.com/kZAgdk

How to find amount of integer solutions of inequality with Euclidean algorithm div1 E ?

https://codeforces.com/blog/entry/53007

My solution for div 2 F: Cookies gives WA verdict on test 6. I followed the same approach as given in editorial. Can someone kindly point out my mistake? Thanks in advance. 49932059

IN problem Sum in the tree 10 1 1 2 2 2 3 7 7 7 1 2 -1 -1 3 2 -1 2 3 4 As per question for this test case solution should provide ans as 7 but most of solution is giving -1 as answer. Correct me if I am wrong.

In Div-2 C, when the required character(req) is more than the characters given in the string,

Let, si = req — the characters given in the string(excluding '?'&'*')

If we keep all the non-mendatory characters and repeat the character preceding first occurance of a snowflake si times, then we get a string with the length of required size.

But this approach is giving me wrong answer. Can someone point out what's wrong?

In problem 1098D Eels, if we use

`set`

or`priority_queue`

to maintain each half-interval, isn't the complexity O(log^2 n) pre query(instead of O(log n)) ?