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

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

hi everyone, I hope all of you doing well, I need help with this problem with proof for the solution to understand all the details plz . I was trying to play with the binary representation of the numbers because of the very large constrains of ai but i didn't reach for any valid solution. https://codeforces.me/edu/course/2/lesson/9/2/practice/contest/307093/problem/G

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

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

.

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

Notice that $$$gcd[l,r] \geq gcd[l,r+1]$$$, therefore you could binary search the answer by fixing $$$l$$$ and using some range data structure like segment tree or sparse table.