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

Автор didaihocdaihoc, история, 9 лет назад, По-английски

i get stuck on problem, i try to solve it,but i don't come up with any idea:

statement :

input : a given sequence n and number k

task : count all sequence that thier product is less than or equa k.

ex :

input : 9 10

11 1 2 1 1 5 10 2 3

ouput : 10

hope your help. thank you!

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

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

If you wonder why you're getting downvoted, it is because you haven't mentioned the limits of N and K, and you haven't explained what is a sequence (subsequence or subarray-a contiguous subsequence). If you want to count the subarrays, then you can do it with the 2-pointer technique. If not, in N*K with a standard dp. You should also mention whether the numbers can be negative or 0