Блог пользователя ne_justlm

Автор ne_justlm, 19 месяцев назад, По-русски

Спасибо за участие в самом исекайнутом контесте на NyaForces!

Мы честно-честно старались над задачами.

2072A - Новый мир, новый я, новый массив

Идея: ne_justlm

Разбор
Решение
Оценка задачи

2072B - Будучи казначеем в прошлом, я помогаю гоблинам обманывать людей

Идея: ne_justlm

Разбор
Решение
Оценка задачи

2072C - Создание ключей от хранИЛИщ стало моим основным навыком

Идея: ne_justlm, IceHydra

Разбор
Решение
Оценка задачи

2072D - Для магов нет ничего сложного в экзамене, но я его не осилил

Идея: ne_justlm

Разбор
Решение
Оценка задачи

2072E - Тебе же нравится герой, который бьёт по площади двойным уроном?

Идея: ne_justlm

Разбор
Решение
Оценка задачи

2072F - Прощай, жизнь банкира, здравствуй, жизнь мага

Идея: itz_pabloo

Разбор
Решение
Оценка задачи

2072G - Переворачивая числа 300 лет, сам того не заметив, посчитал сумму

Идея: ne_justlm, IceHydra

Разбор
Решение
Оценка задачи
Разбор задач Codeforces Round 1006 (Div. 3)
  • Проголосовать: нравится
  • +67
  • Проголосовать: не нравится

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

F was so good!

Apart from the Pascal's triangle solution, You can do it by recursion and I learned that the self-similar repeating fractal pattern formed by F is called a Sierpinski's triangle!

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

nice

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

Thanks to the authors for a good round

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

constructive contest

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

For the F, if we use Lucas' Theorem, we can actually deduce that $$$\binom{n}{k}\mod 2$$$ is 1 only if $$$k$$$ in binary is a submask of $$$n$$$, in other words if $$$k$$$&$$$n$$$ equals $$$k$$$

With this there's an elegant two-line solution in $$$O(n)$$$:

int a,b;cin>>a>>b;a--;
for(int i = 0;i<=a;i++) cout << (int)((a&i)==i)*b << ' ';
»
19 месяцев назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

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

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

some how deepseek solved G on first try

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

ne_justlm In fact, the first part of the problem G is not $$$O(\sqrt{n} \log n)$$$. The reason is that the total time is equal to $$$\sum\limits_{i=2}^{\sqrt{n}} \frac{\ln n}{\ln i}$$$, and since the logarithmic integration yields a complexity of $$$\int\limits_{2}^\sqrt{n} \frac{1}{\ln x} dx=O(\frac{\sqrt n}{\ln n})$$$ for the latter part, the total complexity is $$$O(\sqrt{n})$$$

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

In the problem F, you said that we will build each the numbers in the n-th rows bit by bit, but why in the solution you just multiply it with the odd condition. I understand that when we have odd condition of power of 2 then the bit i-th at which Ki is set also must be set for the number, but do multiplication hold this property? Or how can I relate multiplication with xor property, thank.

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

For the F , I tried to print out the triangle to find the pattern, and finally I found that they meet this pattern, can someone help prove it?

        for(int i =0;i < n;i++)
        {
            if((i|(n-1))==n-1)
                cout<<k<<' ';
            else
                cout<<0<<' ';
            cout<<endl;
        }
»
19 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Problem F: Not too different from the official solution, but I calculated the parity of binomials using the following formula:

$$$\begin{align*} \binom{n}{0} &= 1 \\ \binom{n}{r} &= \binom{n}{r-1} \cdot \frac{n - r + 1}{r} \end{align*}$$$

Then you can sequentially count the numbers of factor $$$2$$$ in the denominator and the numerator for each $$$r$$$.

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

    "count the numbers of factor 2 in the denominator and the numerator"

    what do you mean by this ?

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

      Let's say you can denote $$$\displaystyle \binom{n}{r}$$$ as a fraction $$$\displaystyle \frac{p}{q}$$$ (note this value is always an integer). Let's extract the factors of $$$2$$$ from $$$p$$$ and $$$q$$$:

      $$$\begin{align*} p &= 2^s \cdot p^\prime, \\ q &= 2^t \cdot q^\prime. \end{align*}$$$

      Where $$$s \ge t$$$ since $$$q$$$ divides $$$p$$$. Then the following holds:

      $$$\begin{align*} \frac{p}{q} \ \text{is even} \iff s \gt t. \end{align*}$$$

      Therefore, to find the parity of $$$\displaystyle \binom{n}{0}, \binom{n}{1}, \ldots, \binom{n}{n}$$$, you only need to count the number of factor $$$2$$$ s that appear in the denominators and the numerators in those values, instead of calculating those values in full. And this can be done sequentially, from $$$\displaystyle \binom{n}{0}$$$ to $$$\displaystyle \binom{n}{n}$$$, using the formula I wrote in the post above.

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

How tf did newbies and pupils know lucas theorem for F ???? Anyways F is a beautiful problem.

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

Seems like proof for E is not complete as "For k <= 446, the algorithm places no more than 43 sticks", how do we get this 43 sticks, do you proceed the same proof with upper bound is 446 instead of 10^5 and repeat for the next upper bound until reach 0? Do we have any formal proof, thank you!

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

Can anyone explain me why (n^2) solution worked in problem D? Because timeComplexity is (testcases*n*n) => (10^4 * 10^3 * 10^3) => 10^10 which is greater than 10^8, then why it not giving tle

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

Nice problem statements

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

In the third case where $$$\log_p{n} \le \log_{\sqrt{n}}{n}$$$ , in the case where they are equal wouldn't the number of digits be $$$\log_p{n} + 1 = 3?$$$

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

kinda surprised this submission for E didnt TLE. i guess recursion is not so bad

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

Желаю здоровья, счастья и хороших контестов идейному вдохновителю названий для этих задач.

(Ну и другим составителям раунда тоже всего хорошего)

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

I wasn't expecting D to be brute force of the nested loop type

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

I think F can be solved by Lucas theory.Here my solution. ~~~~~ int n, k; cin >> n >> k; n -- ; for (int i = 0; i <= n; i ++ ) { cout << ((i & (n — i)) == 0 ? k : 0) << " \n"[i == n]; } ~~~~~

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

[submission:341537826]why my code tle case3,i cant understand,sos!

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

sooooo many math :(