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

Автор cry, 13 дней назад, По-английски

Judge Code will be added after hacking phase.

1996A - Legs

Problem Credits: cry
Analysis: cry

Solution

1996B - Scale

Problem Credits: sum
Analysis: cry

Solution

1996C - Sort

Problem Credits: cry
Analysis: cry

Solution

1996D - Fun

Problem Credits: sum
Analysis: cry

Solution

1996E - Decode

Problem Credits: cry
Analysis: cry

Solution

1996F - Bomb

Problem Credits: sum
Analysis: cry

Solution

1996G - Penacony

Problem Credits: cry
Analysis: cry, awesomeguy856

Solution - Segment Tree
Solution - XOR Hashing (by awesomeguy856)
Разбор задач Codeforces Round 962 (Div. 3)
  • Проголосовать: нравится
  • +45
  • Проголосовать: не нравится

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

cry orz

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

Couldn't solve D. RIP my brute force skill.

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

After reading problem F You realize that nuclear bombs take so much time to bomb!

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

G reminds me of this JOISC problem

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

In problem F: We are searching for the largest x such that f(x)≤k

Won't we reach infinity by doing that?

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

My solution for problem F:

let's find the minimum number X, where X is the smallest number that all numbers in array a can be less or equal than using at most k operations.

then, you calculate the answer for making all the numbers in a less than X, and maintain values k and a[i] for each i.

After all you will be left with k operations, so you add to the answer : number_in_a_equal_X * k

link to my solution

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

    isn't that the same solution as mentioned in the editorial?

    oh, ohk i get it, you sped up the last part of solution by doing number_in_a_equal_X * k. That's good.

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

Amazing xor-hashing solution for G, love it!

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

great contest, really fun problems. i wish i managed to solve E on time as well but oh well

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

Can anybody tell why this solution for C is getting MLE?

Submission

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

please can anyone explain why my code works or if it can get hacked please hack it : ), i will be so happy (https://codeforces.com/contest/1996/submission/272827778)

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

    I think it can't be hacked because worst case I found O(2 * 10^9) , and it's fast enough for your code to pass because the operations sums and multiply aren't that heavy.

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

      If in the same code we replace int by long long, it gives tle on the first test case itself. Why is this the case?

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

Can anyone explain how this code works? I don't understand it. Also, can you provide some sources that explain how it works? Thanks! 272756177

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

cry sum Is there a penalty on unsuccessful hacking attempt?

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

Thank you for the editorial ! There is just a little typo in the explanation of problem E. You wrote in the line before the last one $$$(x+1) \cdot ((n-y_1+1) + (n-y_2+2) + ... + (n-y_k+1))$$$. It shouldn't be $$$n-y_2+2$$$ but $$$n-y_2+1$$$

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

Solved ABCD, hope to become pupil

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

O(n) solution of D :

wlog assume a <= b <= c

claim : atleast a, b <= √n

proof : if b > √n, b * c >= b * b > n which proves the claim so iterate on a and b till √n and count the permutations, this can be done in many ways

submission

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

Why will the "remaining operations will all add (x — 1)" in the solution for F?

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

DIV 3 — C

Easiest python implementation using 26 cross n array:

272842563

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

can anyone please explain me the editorial of Problem D "Since ab+ac+bc≤n , we know at the minimum, ab≤n . " or is their any other approach please share

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

    The constraint ab + ac + bc ≤ n implies that individually, each pairwise product should also be less than or equal to n . Thus, we know that:

    ab ≤ n , ac ≤ n , bc ≤ n

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

Did some people really did 4th one with brute force??

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

Why I'm Getting TLE 272870887 (problem C).

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

Great contest :) Hope to regain pupil title.

My math ain't mathing for D :( . What a mathy math

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

Anyone tried G with greedy then use segment tree? Like sort or pair by ascending order of min(b-a, n+a-b), assume a<b, then tried to input range [a,b] or [b,n],[1,a] to find which one is minimum. I do not know whether is works, as I tried sometimes but fail