Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

Автор MankS, история, 17 месяцев назад, По-английски

So i recently came across this question:- You are given values 1 2 3 4 5 6 7 8 9 10 11 .... In each iteration all nth values are removed. n starts from 2 and goes on. So the numbers after first iteration are 1 3 5 7 9 11 13 15 17 ...as all second values are removed Now in next iteration all 3rd values are removed,therefore we have 1 3 7 9 13 15 ... And so on. Given a number,tell whether it will be removed or stay in the series,and if it is removed,then in which iteration. It would be great if I could get help in knowing the approach and resources if any for this question. Thanks a lot.

Полный текст и комментарии »

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