Editorial for Modulo 6


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.
  • Nếu N < K thì đáp án sẽ là 0
  • Nếu N = K thì x có thể là bất kỳ số nguyên dương nào lớn hơn N. Vì vậy có vô số câu trả lời.
  • Trường hợp còn lại là N > K. Gọi x là một số nguyên dương bất kỳ thỏa mãn. Điều đó có nghĩa N mod x = K với K < x. Suy ra đáp án của bài là số lượng ước số của N-K lớn hơn K. Ta có thể giải bài này với đpt O(\(\sqrt{N-K}\))


Comments

There are no comments at the moment.