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

Автор sourav_malo, история, 5 лет назад, По-английски

As you know that Educational Codeforces Round 54 (Rated for Div. 2) was held yesterday. Perhaps, you solved 1076B - Divisor Subtraction without any difficulty. Now, I am thinking how to solve this problem if there are no less than 10^5 queries. Please, mention the complexity with approach.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

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

owowow

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

if you lower the limit of n to 1e7 than you can have as many queries as you want, but i dont think 1e10 is gonna do well for more than 100 queries...

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

    There are around 1e4 primes lesser than 1e5 so you can optimize it to work for around 1e4 queries (and maybe faster with pollard rho?)

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

Has there any way to find at least a divisor of n smaller than sqrt(n) within at most 1000 loops where n<=10^10?

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

    Isn't this question equivalent to integer factorization at the worst case? Then, I suppose there are no known way to do the task in 1000 loops...

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

      I thaught that also...whatever,thanks bro....

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

        As tfg mentioned above, for a lot of queries, to precompute all the primes in range [2, 1e5] would be fastest. Then your task must cost at most which is larger than 1000