Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

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

Автор mesanu, история, 4 года назад, По-английски

This is the editorial for the Unofficial Div4 Round#1 created by SlavicG and mesanu.

Announcement

Previously you could only virtually participate, now the contest is open for practice!

Invitation link for the contest: https://codeforces.com/contestInvitation/d477e058f265a72092af5c11074234d720a0fb5f

PROBLEM A:

Alin and Money

PROBLEM B.

Sanda's Homework

Problem C:

Gicu's way Home

Problem D:

Game of GCD

Problem E:

Strange Pool
  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

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

In problem D, (if k is odd)I found out the minimum divisor(let's say min) (min>1) of the maximum number of the array then counted all the numbers divisible by min. If count is either 1 or n-1 then answer is YES otherwise NO.

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

    I can give a counter example

    2 2 2 5 27

    By your algorithm this should print YES however the answer is NO.

    Look like the tests weren't strong enough.

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

What will be the rating of problem D and E on Codeforces?

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

I think D should've been E and vice versa. thanks for the good problemset :)

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

Clean solution for problem E using pbds

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

Editorial of D:

I think you have made a mistake when you said he can always insert a prime number such that the gcd of the array is 1, this is actually not true because lets say your current array is $$$[10]$$$ inserting prime number $$$5$$$ would make the gcd $$$5$$$. I think it should be corrected to say insert the value $$$1$$$. because surely when you insert $$$1$$$ the gcd would definitely be $$$1$$$.

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

    But he said a prime number, but didn't mentioned that all prime numbers will satisfy the condition. But I also think that inserting 1 is a better idea.

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

      This is actually true ! but I wanted to correct the understanding that many people have which is a lot of people always think that the taking gcd with a prime number would yield $$$1$$$ which absolutely incorrect an example would be $$$gcd(7, 14) = 7$$$ or $$$gcd(5,5) = 5$$$. a lot of times people when they hear $$$gcd = 1$$$, they think prime numbers.

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

    If the gcd of the array is x then Bob should insert any number coprime with x, doesn't matter if it is prime or not. I said he can insert a prime number because all primes are coprime with other primes. Also 1 works like sazid mentioned

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

Very nice contest ! Good job guys !

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

Will there be more such Rounds? It's good for Beginners to Practice.

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

nice problem D! i used seive for 100 nums in O(1) then i counted the number of ai divisible by a prime p for each prime then take the max count if >= n-1 then yes, else no and it worked.