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

Автор 74TrAkToR, история, 4 года назад, По-русски

Спасибо за участие!

1744A - Number Replacement придумал MikeMirzayanov, подготовил 74TrAkToR

1744B - Even-Odd Increments придумал и подготовил 74TrAkToR

1744C - Traffic Light придумали MikeMirzayanov и 74TrAkToR, подготовил 74TrAkToR

1744D - Divisibility by 2^n придумал и подготовил 74TrAkToR

1744E2 - Divisible Numbers (hard version) придумал и подготовил 74TrAkToR

1744F - MEX vs MED придумал и подготовил 74TrAkToR

Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Разбор задач Codeforces Round 828 (Div. 3)
  • Проголосовать: нравится
  • +52
  • Проголосовать: не нравится

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

Nice Editorial, and very nice round!

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

This is so sad. If I knew that the max number of divisors in a number < 1e9 is 1344 I for sure could have finished question E2 because I had the same idea is the editorial. :(((

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

Since x⋅y must be divisible by a⋅b, the following conclusion can be drawn: y must be divisible by a⋅b/gcd(a⋅b,x)

Can anyone please prove this how in the problem E.

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

    This is not something that you "prove". It is something that you intuitively know. When you unpack this statement it doesn't actually say much but the math makes it kind of convoluted so I'll explain it. To have some x*y be divisible by a*b, the set of prime divisors in a*b should be a subset of prime divisors in x*y. In other words, for every prime divisor in a*b, that prime divisor should also exist in x*y. Now if you think about it, gcd(a*b, x) simply means the set of prime divisors in x, which are also prime divisors in a*b. This means that the y that you choose only has to contain the prime divisors that is in a*b but not in x. This is given by the expression u gave ((x*y)/gcd(a*b, x)).

  • »
    »
    4 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    Both x and y should together make up a*b
    => so x should have some part of a and some part of b. 
    => so y should have some part of a and some part of b.
    
    This some part which is I mentioned above is nothing but "factor of a given number"
    Now x and y can be written as
    x = afact1 * bfact1 * k
    y = afact2 * bfact2 * k
    
    Here k is some constant, afact1 and afact2 is factorials of a, bfact1 and bfact2 are factorials
    of b and also note that a = afact1 * afact2 = a, b = bfact1*bfact2
    
    so fix afact1 and bfact1 we get afact2 = a/afact1 and bfact2 = b/bfact1
    
»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The Editorial didn't add to Contest materials and lots of ppl don't know that it comes

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

Раунд топовый! Но чутка не хватило мне, чтобы доделать F. Типа я дошёл до того, что нам нужно кол-во отрезков, внутри которых l...r и их длина <= 2 * mex, но не успел довести до финала. Я после раунда у друзей спросил, они формулу написали, но тут оказывается ещё проще было. F классная задача)

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

Nice Editorial,thanks.

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

Anyone know how so many solution for E were being hacked? What did the test case contain?

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

Some please explain F

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

Can anyone please explain why this code is not working? This is the code for Problem D.

178113368

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

    Hi, your solution is almost correct... When choosing which indices to apply the operation on, you went from N to 1, but a bigger number doesn't necessarily mean a bigger number of twos. Take for example 5(0) and 4(2). So instead of going from N to 1, you should sort the indices by their number of twos and go from the biggest to the smallest. Hope this helps <3

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

I have a better time complexity solution for E, which works in O(sqrt(a) + 1344 * log(1344)).

I have no idea why this works. Can somebody please help? https://mirror.codeforces.com/contest/1744/submission/186708442

The code iterates through all factors of a (say p) and finds the largest factor of b (say q) such that x = a * q / p and y = b * p / q. Then it takes the multiple of x just smaller or equal to c and the same for y. The code then swaps the numbers and does it again.

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

2333 But I'm a Chinese primary student.

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

MikeMirzayanov, this blog's API shows not found: https://mirror.codeforces.com/api/blogEntry.view?blogEntryId=108101

{
  "status": "FAILED",
  "comment": "Blog entry with id 108101 not found"
}

Probably this was generated from a Russian blog.

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

But how are you guaranteeing that the "x" in the solution for E2 will always be in between "a" and "c+1" for every gcd "g" ?!

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

    I'm a bit late, but you just say that since $$$a \lt x \leq c$$$ and $$$g$$$ divides $$$x$$$, we just check if there's a multiple of $$$g$$$ that is between $$$a$$$ and $$$c$$$. This can be done similarly to the $$$y$$$ check: the largest $$$x$$$ possible is $$$\lfloor\frac{c}{g}\rfloor \cdot g = x_{max}$$$, so check if $$$a \lt x_{max}$$$.

    You might think that by choosing $$$x_{max}$$$ this way the gcd could change: $$$gcd(ab, x_{max}) \gt g$$$ and that's true, but it doesn't actually matter: we assume that $$$g$$$ is the gcd, then we find some $$$y = \frac{ab}{g} \cdot k$$$, where $$$k$$$ is some constant, but since the real $$$gcd(ab, x_{max})$$$ is greater than $$$g$$$, that means that our $$$y$$$ is greater than it needed to be, which certainly doesn't hurt us (because we will check the bigger gcd at some point later on).