chillmills4869's blog

By chillmills4869, history, 11 months ago, In English

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

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
11 months ago, # |
Rev. 2   Vote: I like it +13 Vote: I do not like it

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.