Комментарии
На _Crimson_Codeforces Round #1070 (Div. 2), 5 месяцев назад
+10

Don't worry, there is a strong evidence that he cheated, so probably he will be banned.

На _Crimson_Codeforces Round #1070 (Div. 2), 5 месяцев назад
+8

The Editorial will be published soon.

На Proof_by_QEDCodeforces Round 998 (Div. 3), 15 месяцев назад
0

Not necessarily. At least I used dfs and dfs only. I found all the components in the second graph and deleted such edges from the first graph, that connect $$$(u, v)$$$ from different components. Then I just calculated the amount of components $$$A$$$ in the first graph and the amount of components $$$B$$$ in the second graph, adding their difference $$$A - B$$$ to the answer.

На nifesheCodeforces Round #997 (Div. 2) Editorial, 15 месяцев назад
0

It seems like i completely overcomplicated D, because i solved it in $$$O(nA^2 + A^4)$$$.

На awooEducational Codeforces Round 173 Editorial, 16 месяцев назад
0

I know right? I just solved it performing necessary operations on each row and column once, and i repeat it 100 times. It passes all the tests.

На BledDestEducational Codeforces Round 173 [Rated for Div. 2], 16 месяцев назад
-8

Actually, prime numbers are pretty regularly distributed. So you can always find a prime number on a long enough segment. That's why yours and similar solutions work.

На Little09Codeforces Global Round 28, 16 месяцев назад
0

You can also think about it this way (which is basically the same proof). If $$$m = n$$$, then you have $$$4n^2$$$ edges and at least one color should use $$$4n$$$ edges. But a forest on $$$4n$$$ vertices can have at most $$$4n - 1$$$ edges, so there's definitely will be a cycle.

Also if $$$m$$$ is strictly greater than $$$n$$$, you can always consider any part of this graph with $$$2n$$$ vertices on the left, and exactly $$$2n$$$ vertices on the right, since this subgraph will contain a cycle for the same reason.

На Little09Codeforces Global Round 28, 16 месяцев назад
0

Is it hard to rewrite your solution using stack to store dp states?

На Igor_ParfenovCodeforces Round 992 (Div.2), 17 месяцев назад
+9

Just fill everything in dfs with odd numbers starting from 1. When you fill children of some node u, skip odd number x + 2, where x is the parent's odd number. In the end you'll have at most one unfilled node, so just fill it with even number x + 1, where x is the parent's number. It works because the difference of two non-adjacent odd numbers is an even number greater than 2.

На MohammadParsaElahimaneshRayan 2024 Selection Round Editorial, 17 месяцев назад
+24

It's pretty obvious, because if you use all $$$n!$$$ permutations, you get the same sum $$$S$$$ in each column. Then, if you remove any permutation, the sum in each column will be unique.

For example if you remove something like $$$[1, 3, 4, 2]$$$, then the sum in each column will be $$$[S - 1, S - 3, S - 4, S - 2]$$$.

0

Note that if you have a prime like 1021, then you can't reach 2077, and 2077 is not prime

На TheScrasseHow to solve easy problems?, 18 месяцев назад
0

I'm actually wondering about problem E from Global Round. I tried different ways to bruteforce it, but it got either TL or WA. Then I just additionally bruteforced around $$$\sqrt{(z*y/x)}$$$, which is an optimal point for $$$f(u) = x * u + y * z / u$$$, where u — is the number of upgrades used. As you can see this function is simplified and doesn't consider the restriction given by $$$k$$$. Surprisingly it still worked, and I don't know why. Maybe the optimal point doesn't shift that much, or maybe it's just hard to make strong tests in this problem.

На pashkaJetBrains Youth Coding Club, 19 месяцев назад
0

Thank you for response!

На pashkaJetBrains Youth Coding Club, 19 месяцев назад
+16

Is it for students only? What if I lack math skills and want to participate in the Math Club?

+11

Bitset

Good luck everyone!

What I did is

Spoiler
На AndreyPavlovCodeforces Round #846 (Div. 2), 3 года назад
-10

And this round

This is for the sake of brevity. You can see that the edge CB is a little bit longer than AC. Apparently that means that there are some nodes on a path between B and C

На gotexansCodeforces Round #655 Editorial, 6 лет назад
0

Then, for every pair of adj. element you take what is left one through one, so there goes (n + 1) / 2 elements in sum. It's easy to understand the proof by looking at pictures, unfortunately i can't attach them :(

На gotexansCodeforces Round #655 Editorial, 6 лет назад
0

It's easy to see how does the answer look like by solving for n = 5. You can notice, that answer will have some pair of adjacent elements, and a few more(maybe 0), separated each from the others with odd number of elements, that will be deleted. Than it's trivial to prove it by induction for any n. If you want, I can draw some pictures to prove this solution

На OkrutCodeforces Round #647 Editorial, 6 лет назад
+5

You can think of C as an "oeis" type task. To solve it, you have to cast a spell "Oh, it must be on oeis". Than you simply generate first few members of the sequence and google it

На vovuhCodeforces Round #595 (Div. 3), 7 лет назад
0

What about n = 10^18? In the first test the answer is 1350851717672992089, but 3^38 > 10^18 and less than test's answer