didaihocdaihoc's blog

By didaihocdaihoc, history, 7 years ago, In English

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!

  • Vote: I like it
  • -18
  • Vote: I do not like it

| Write comment?
»
7 years ago, # |
  Vote: I like it +5 Vote: I do not like it

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