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

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

Question here:

https://atcoder.jp/contests/abc239/tasks/abc239_d

The question for the limits is brute but what is the approach if all a,b,c,d can be upto 10**5. I could not figure anything out on that case. Please help me

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

»
5 месяцев назад, # |
Rev. 2   Проголосовать: нравится +13 Проголосовать: не нравится

The maximal prime gap upto $$$2\times 10^5$$$ is about $$$100$$$. So if $$$D-C$$$ is greater than this gap, the second player wins. Otherwise brute force to find the answer.