Satoru's blog

By Satoru, 17 months ago, In English

Hello codeforces

Can you help me solve this problem:

Given an array of size $$$k$$$, the sum of it's elements is equal to $$$n$$$, print a binary string of size $$$n$$$ ('$$$1$$$' if you can create $$$i$$$ by taking a subset from the array, '$$$0$$$' otherwise)

Example

UPD: Constraints: $$$1 <= n, k <= 10^5$$$

UPD2: thanks imachug for the solution

Read more »

 
 
 
 
  • Vote: I like it
  • +42
  • Vote: I do not like it